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.

I'm running a Django web application and have 4 instances of Apache running ModPython on my main webserver. I'm running Nginx on the front end and Nginx proxies all Django url's to the apache server pool.

How do I know if I need to run more instances of Apache to handle increased load? I've had a few complaints about timeouts and my first thought was that there weren't enough Apache instances running.

UPDATE: Correction, I'm running one instance of apache that has 4 child processes. They do show up as 5 distinct processes using "ps -ef | grep apache" on Linux.

share|improve this question
1  
You're running four copies of Apache? Madness. –  womble Nov 24 '09 at 19:13
    
The obvious question is - Why? More than likely your problem is that you are running multiple instances, which are now fighting for resources. –  John Gardeniers Nov 24 '09 at 21:18
add comment

1 Answer

up vote 2 down vote accepted

You don't need separate instances of Apache running on the same server like this, you'll only consume more memory that way. Have one Apache setup with multiple children if needed (depending on the worker model you use "children" here could mean processes, threads or threads within multiple processes).

If the problem is "not enough Apache to serve the requests" I would expect 50x errors (from Apache directly or from nginx) rather than timeouts (unless the error your users are seeing is a 50x error page from nginx saying it timed out waiting for Apache to deal with a long request or accept a new one).

You need to get more detail on the "timeouts" that your users are seeing as it could be many things - the error could be coming from their end, nginx, apache, your python code or your database.

Also, monitor the memory use (including swap), CPU load and I/O throughput so you can see if there is an obvious clue to the problem there when timeouts are next reported.

share|improve this answer
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.