7

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.

  • If someone claims that Apache is unstable when running 400 hosts on a single machine, it's probably because he's running into load and resource limits on that machine. You say that load is irrelevant for the question, but then you reference someone who is likely running into load issues. – Stefan Lasiewski Jun 15 '10 at 0:42
  • # ls |wc -l 956 though, needed to update the number of filehandles for it to work. – user6738237482 Jun 15 '10 at 1:40
  • We have upwards of 1800 vhosts so far and no issues. I don't know what the maximum is though. – JDS Dec 20 '11 at 21:48
8

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.

| improve this answer | |
  • BTW, in docs there is nothing about limits other than fds – Vladislav Rastrusny Jun 14 '10 at 18:37
  • An easy solution to the FD limits would be to remove the log configuration from your VirtualHost sections, and instead use the global logging configuration in httpd.conf. This way everything is logged to one access log and one error log. Just be sure to log the VirtualHost name in the logfile. Why have 64 Access Logs plus 64 Error logs when you could simply have 2 logfiles, and then parse out the VirtualHost name afterwards (Hopefully after you ship them to a non-webserver host). – Stefan Lasiewski Jun 15 '10 at 0:40
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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