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

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.

share|improve this question

migrated from stackoverflow.com Jun 14 '10 at 23:10

This question came from our site for professional and enthusiast programmers.

    
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
add comment

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
BTW, in docs there is nothing about limits other than fds –  FractalizeR 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
add comment

Your Answer

 
discard

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

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