Traffic
Slow start
A server that just restarted has a cold cache, an empty connection pool and, if it is a JVM, no compiled code yet. Give it a third of your traffic in one go and it can fall straight back over.
Why flapping is worse than being down
A backend that comes back, gets slammed, falls over, comes back and gets slammed again is worse for your visitors than one that simply stayed down. Each cycle takes capacity away from the servers that were coping, and each cycle causes a config rewrite and a reload.
How it works here
The paid nginx has slow_start=30s on a server, handled inside the process. Free
nginx has nothing. The manager does it by ramping the weight instead.
A backend that comes back healthy goes in at weight 1. Over the window you choose, the weight climbs in steps until it reaches whatever you configured. Each step is a config rewrite and a graceful reload.
It is not as smooth as doing it inside the process, because it moves in steps rather than continuously. In practice a handful of steps over thirty to sixty seconds does the job, because the point is only to avoid hitting a cold server with everything at once.
Choosing a window
| Application | Reasonable window | Why |
|---|---|---|
| A small stateless service | 10 to 15 seconds | There is not much to warm up. |
| A typical web application | 30 seconds | Connection pools and caches fill quickly. |
| A JVM application | 60 to 120 seconds | The just in time compiler needs real traffic before it is fast. |
| Anything with a large local cache | 120 seconds or more | The cache is the whole point of the server and it starts empty. |
Pair it with a good health check
Slow start only helps if the backend says it is healthy at roughly the right moment. A check that only opens a connection reports healthy the instant the process starts, long before the application can serve anything. A check that touches the database reports healthy when the application actually is.
Common questions
Does slow start apply when I add a brand new server?
Yes. A member that has just been added and passed its checks is treated the same as one that recovered.
How many reloads does a ramp cause?
A handful across the window. Reloads are debounced, so several backends recovering at once do not multiply.
Can I turn it on for one member and not another?
It is a pool level setting. If one member is genuinely different, give it its own pool.
Step by step instructions
The how to section has searchable, task shaped answers. Search it for slow start.
Related features
Active health checks
Probe every backend on a schedule and pull the dead ones out.
Read moreAdaptive weighting
Give the faster backends more of the work.
Read moreBackend pools
The list of servers behind a site, and how traffic is shared.
Read moreLoad balancing methods
Round robin, least connections, hashing and consistent hashing.
Read more