Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to have v1 of my application in one pool and version v1.1 in another pool and then slowly ramp up the traffic going to pool two and reduce it to pool one.

Can anyone show some concrete examples of doing this with HA Proxy, Varnish, Nginx or something else?

share|improve this question
And how you intend to you mange the database schema changes? – Mircea Vutcovici May 1 '12 at 16:05
Schema changes can best be approached by staggering the change. Add a new column in v1.1, use the column in v1.2, stop using the column in v1.3, delete the column in v1.4. – markba May 1 '12 at 16:08
up vote 3 down vote accepted

The split clients module is designed specifically for this:

# I like starting my upstream names with _
# so they're not confused with hostnames
upstream _old_upstream {

upstream _new_upstream {

# Make sure the values here match the names of the upstream blocks above
split_clients $remote_addr $split_upstream {
   10% _new_upstream;
   -   _old_upstream;

server {
  location / {
    # EDIT: I forgot, when using variables in a proxy_pass, you have to
    # specify the entire request
    proxy_pass http://$split_upstream$request_uri;

Then, as you want to move more traffic to the new server, just change the percentage and run nginx -s reload.

share|improve this answer
Thank you, I'll give this a try. – markba May 1 '12 at 16:29
I updated the config because I forgot that you have to specify the entire request when using variables in a proxy_pass – kolbyjack May 1 '12 at 16:34
The documentation is now located at: – Thymine Feb 23 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.