Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 - foo.heroku.com 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

2 Answers 2

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" httpd.apache.org/docs/2.0/vhosts/mass.html - both in apache and nginx (probably haproxy too) - with apache you can have a hosts.map file which maps domains to the back end servers. –  anton Mar 29 '10 at 2:08
1  
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: http://heroku.com/how/architecture

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

 
discard

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