---
title: "Saving Millions of Dollars by Bin-Packing ClickHouse Pods in AWS EKS"
description: "ClickHouse Cloud raised EKS cluster CPU utilization from about 50% to 70% by switching the Kubernetes scheduler's NodeResourcesFit scoring from LeastAllocated to MostAllocated, cutting node count by roughly 10% and EC2 cost by over 20%."
url: "https://swe.quest/articles/saving-millions-of-dollars-by-bin-packing-clickhouse-pods-in-aws-eks-dd42beab98fa8427"
canonical: "https://clickhouse.com/blog/packing-kubernetes-pods-more-efficiently-saving-money"
source: "ClickHouse"
published: "2023-10-12"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["kubernetes","cost-optimization","scheduling","cloud","capacity-planning"]
---

# Saving Millions of Dollars by Bin-Packing ClickHouse Pods in AWS EKS

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-10-12, 9 min read, Case study. Original: [https://clickhouse.com/blog/packing-kubernetes-pods-more-efficiently-saving-money](https://clickhouse.com/blog/packing-kubernetes-pods-more-efficiently-saving-money)

## Summary

ClickHouse Cloud raised EKS cluster CPU utilization from about 50% to 70% by switching the Kubernetes scheduler's NodeResourcesFit scoring from LeastAllocated to MostAllocated, cutting node count by roughly 10% and EC2 cost by over 20%. Because EKS doesn't allow kube-scheduler customization, the team deployed a separate kube-scheduler with leader election and pointed pods at it via schedulerName. They rejected lowering autoscaler thresholds, overprovisioning and safe-to-evict on ClickHouse pods as too disruptive for stateful workloads. Supporting fixes covered annotating system pods as safe-to-evict and moving overprovisioning pods onto the same custom scheduler so preemption works. Stress tests and P90/P99 cold-start measurements showed negligible impact, and the change was rolled out region by region.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Kubernetes](https://swe.quest/tags/kubernetes.md) (Infrastructure)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Scheduling](https://swe.quest/tags/scheduling.md) (Distributed systems)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [Capacity planning](https://swe.quest/tags/capacity-planning.md) (Reliability & operations)

## Prerequisites

- Kubernetes scheduling basics ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- Kubernetes cluster autoscaler ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- AWS EKS ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))

## Keywords

ClickHouse Cloud, AWS EKS, kube-scheduler, MostAllocated, NodeResourcesFit, cluster autoscaler, eks-node-viewer, PodDisruptionBudget

## Related posts

- [Fixed cadence to seconds: making ClickHouse Cloud autoscaling more reactive](https://swe.quest/articles/fixed-cadence-to-seconds-making-clickhouse-cloud-autoscaling-more-reactive-1b4745e879b2e9ce.md): ClickHouse · 2026-08-04 · Medium · 13 min read · Kubernetes, Capacity planning, Go, Analytics & OLAP, Event-driven architecture
  ClickHouse Cloud's vertical autoscaling recommender moved from a fixed timer loop to a controller-runtime based design, so services that hit memory pressure get a recommendation in seconds instead of waiting for the next scheduled pass.
- [Building ClickHouse Cloud From Scratch in a Year](https://swe.quest/articles/building-clickhouse-cloud-from-scratch-in-a-year-f29d54507578a627.md): ClickHouse · 2023-03-16 · Medium · 23 min read · System design, Cloud platforms, Kubernetes, Analytics & OLAP, Multi-tenancy
  ClickHouse Cloud was built in about a year on a "shared everything" architecture: compute and storage are separated, object storage (S3/GCS) is the primary store, and local SSDs handle caching and metadata.
- [Detect, act, keep the evidence: node reliability across three clouds](https://swe.quest/articles/detect-act-keep-the-evidence-node-reliability-across-three-clouds-325dce2a6ee99e58.md): ClickHouse · 2026-11-19 · Medium · 14 min read · Kubernetes, SRE, Resilience, Cloud platforms, Observability
  ClickHouse Cloud owns node-failure detection and reaction itself across AWS, GCP and Azure, because many real failures leave Kubernetes nodes Ready while workloads degrade.
- [Bonree replaces ZooKeeper with ClickHouse Keeper for drastically improved performance and reduced costs](https://swe.quest/articles/bonree-replaces-zookeeper-with-clickhouse-keeper-for-drastically-improved-6eee02db0b20c225.md): ClickHouse · 2024-07-22 · Hard · 11 min read · Analytics & OLAP, Consensus, Distributed systems, Observability, Cost optimization
  Bonree migrated the coordination layer of its ClickHouse-based observability platform from five 3-node ZooKeeper clusters to a single ClickHouse Keeper cluster.
- [The Best Managed Kubernetes Hosting in 2026](https://swe.quest/articles/the-best-managed-kubernetes-hosting-in-2026-7c6dc96dc69f229d.md): Railway · 2026-05-26 · Easy · 14 min read · Kubernetes, Cloud platforms, Cost optimization
  Kubernetes is only worth its operational cost for four kinds of teams: large service fleets, dedicated platform teams, BYOC or compliance-driven multi-tenancy, and exotic workloads such as GPU pools or custom CNI.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
