What's the performance/memory cost of having many (as in hundreds) VirtualHost directives in Apache? Generally, is it a good idea?
I'm currently working on improving my company's On-Demand infrastructure. What we have is a pretty classic architecture: each customer has a subdomain, customer1.service.com for example, that leads to one of our physical servers (they are VMs actually but it is unimportant so let's call them hosts). Those hosts can serve several customers and, as our service is web-based, we have Apache sending requests to our web application. Basically Apache is an HTTP Proxy and does just that.
As our hosts are not that busy, I would like to be able to have multiple flavours of our application running on each of them and Apache sending our customers to the right application. AFAIK the only way to achieve that is to have one VirtualHost directive per subdomain/customer. As such, I'm basically asking if a hundred of those will work well or present performance issues.
Also, having one Location directive per flavour is not an option because the app is poorly written and doesn't support the extra bit in the path (as in customer1.service.com/v1/).
Feel free to propose anything that might work just better in your opinion.
Thanks!