German Auto-Scaler

Autoscaling for Hetzner Cloud

Hetzner has no automatic scaling. We built it: servers are added when load rises and removed when things calm down. In Germany, without a US cloud.

The gap

Hetzner is strong. Until load rises.

Servers in Germany, fair prices, a German contract partner. What's missing is the automation that big US clouds have built in.

  • No scaling group

    Hetzner Cloud rents out servers but doesn't start additional ones when load rises. There is no built-in autoscaling like on AWS.

  • Peaks cost money

    If you plan for the peak, you pay for servers even in quiet hours. If you plan tight, you risk outages at the most important moment.

  • Manual work in an emergency

    Without automation, someone starts servers by hand at night and then forgets to tear them down.

Hetzner Cloud autoscaling

Capacity that follows the load

Users arrive in the morning, the peak hits at midday, things are quiet at night. The German Auto-Scaler always keeps some headroom above the load and removes what is no longer needed.

  • Enough capacity at peak
  • No paying for idle servers at night
  • No manual work, no forgotten servers
Load over the dayServers provisioned by the auto-scaler

How the auto-scaler works

Five steps, around the clock

  1. 1

    Measure

    CPU and memory utilization per node and open requests per service, continuously.

  2. 2

    Decide

    When the existing nodes are no longer enough, the scaler schedules additional ones. You set the upper and lower limits.

  3. 3

    Create a server

    New servers are created via the Hetzner API at the desired location, in the private network and behind the firewall.

  4. 4

    Integrate

    The node joins the cluster, the load balancer finds it by its label and sends it requests.

  5. 5

    Tear down

    When things quiet down, the scaler drains nodes in an orderly way and deletes them. Requests in progress are completed.

Internet
Hetzner Load Balancer
k3s cluster in a private network
Node 1Node 2new under loadnew under load
German Auto-Scalermeasures load, creates servers via the Hetzner API and removes them again
PgBouncer and PostgreSQLObject storageRedis

Data centers in Nuremberg and Falkenstein

Structure

Kubernetes on Hetzner, autoscaled

A lean k3s cluster in a private network, encrypted with WireGuard. The load balancer distributes across all nodes, including new ones. Data lives outside the nodes so any node can leave at any time.

Features

What the German Auto-Scaler can do

  • Pods and servers

    First the services scale up on existing nodes, then servers are added. The two work hand in hand.

  • Fixed limits

    Minimum count for availability, maximum count for the budget. Nothing grows out of control.

  • Orderly scale-down

    Nodes are drained before deletion. Users notice nothing of the scale-down.

  • German locations only

    New servers are created in Nuremberg or Falkenstein, nowhere else.

  • GitOps

    Rules and limits live in the repository and change via pull request.

  • Alerts

    If the scaler reaches its upper limit or a startup fails, you get notified.

Preparation

Is your application ready for multiple servers?

Only what runs without state in the process can scale. We check these five points beforehand and put them in order.

  1. 1

    Sessions not in the process

    Sessions are stored in the database or a shared store. Then the load balancer can distribute freely.

  2. 2

    Files in object storage

    Uploads on the local disk exist on only one node. We switch to Hetzner's S3-compatible Object Storage.

  3. 3

    Shared rate limiter

    If each instance counts on its own, five login attempts become forty with eight nodes. The counters belong in Redis or in front of the application.

  4. 4

    Migrations before rollout

    If two nodes start at the same time with a pending migration, one fails. That's why migrations run once before rollout.

  5. 5

    Calculate database connections

    The database does not scale along with it. A connection pool such as PgBouncer prevents the ninth node from getting errors instead of responses.

Comparison

Hetzner or US cloud?

Hetzner with German Auto-Scaler

Contracting party
German providers: Hetzner and RMB
Locations
Nuremberg and Falkenstein
Scaling
Servers and services based on load
Costs
Simple server pricing, billed by the hour
Retention
Open building blocks: k3s, Kubernetes standards

US cloud with auto scaling

Contracting party
US corporation, even with the Frankfurt region
Locations
Frankfurt and worldwide
Scaling
Servers and services based on load
Costs
Many individual items, hard to predict
Retention
Often tied to the provider's services

Both approaches scale. The difference lies in the contracting party, data storage and costs.

Who it's for

When the load isn't even

  • SaaS with peak times

    Everyone at once in the morning, hardly anyone at night.

  • Stores and promotions

    Newsletter, campaign or seasonal business without downtime.

  • AI and analytics

    Compute-heavy jobs in waves, then back to small.

  • Regulated platforms

    Data in Germany, without giving up scalability.

Autoscaling on Hetzner

Common questions

Tap a question.