What is the maximum number of virtualhosts Apache can handle?

What is the maximum number of VirtualHosts Apache can handle on a single machine (I don't mean anything related to load, let's suppose it's irrelevant for the question). And we take only Apache without any proxifying things like nginx.

I am asking because on one forum one guy reported that his Apache works unstable with the number of sites more than 400 on a single machine.

If you have a config, that handles more than 400, please tell me here.

Thanks.


Solution 1:

I would read over the Virtual Hosts Documentation.

If each virtual host has its own log, the limit is likely 64 due to file descriptor limits. However, you can configure Apache to run more using this guide.

Solution 2:

At our company we have about 7000 vhosts on a Plesk VPS. In a nutshell, we create single product marketing websites for customers, where each website has it's own unique TLD. In itself this never triggered any issue for performance of Apache, but we did run into other challenges.

Because we create about a 100 new websites each day, Apache needs to restart very often to enable the newly added vhost files. To cover for this, we implemented a caching layer to prevent timeouts on the website each time the server restarts. The real problem comes with handling the large amount of DNS records on the VPS, which pushes the limits of a Plesk server. We are now planning to use an external DNS service like Amazon route 53 to handle the DNS records instead of Plesk.