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 am curious to know how services such as heroku manage 1000's of virtual hosts - ie if you create a web site/app, and put it up on these services, you get your own virtual host name - etc (the same applies to many other sites that have vanity URLs).

I know with various web servers and proxies you can configure as many virtual hosts as you want - but there must be some upper limit to this ? Do they programmatically add virtual hosts - perhaps spreading the load? Or are there other solutions.

share|improve this question

Im not 100% sure on this, but it's possible they use something like Pound.

It's a load balancing non-caching reverse proxy.

share|improve this answer
Looks like there is something called "mass dynamic virtual hosting" - both in apache and nginx (probably haproxy too) - with apache you can have a file which maps domains to the back end servers. – anton Mar 29 '10 at 2:08
That appears to just be a way to reduce the need for long apache config files on webhosts that have a large number of vhosts, and works only on the same physical machine. – Aaron Tate Mar 29 '10 at 3:38

Heroku has a pretty epic system, which is described on their website:

The important part is their routing mesh which is their custom piece of the puzzle that handles redirecting requests to the appropriate "dyno". Since dynos can be spun up and tore down whenever, the routing mesh knows how to find out where the dyno is and route traffic to it. From the sounds of it, it's basically like a super dynamic, database driven version of haproxy written in erlang. That's probably oversimplyfing things though.

share|improve this answer

Your Answer


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