Debugging Apache Lockups

I'm running Apache 2.0 on Ubuntu and I'm getting frequent lockups on port 80. Websites do not respond, the browser does not receive an http error code, it just continuously tries to load. I can "/etc/init.d/apache2 restart" to fix the problem but it returns shortly. I am a noob on Linux and don't know how to begin debugging the problem.

I ran a netstat during one of the outages and didn't see a large number of ports in use, so it's likely not getting attacked.
elmoredanielAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
savoneConnect With a Mentor Commented:
Here is more info on those apache modules:

http://httpd.apache.org/docs/2.0/mod/prefork.html

http://httpd.apache.org/docs/2.0/mod/worker.html

Is that your whole Apache config file?

0
 
savoneCommented:
Have you checked your apache logs?
0
 
elmoredanielAuthor Commented:
Ok, error.log is showing
"[error] server reached MaxClients setting, consider raising the MaxClients setting"

So how do I adjust that setting.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
elmoredanielAuthor Commented:
I have this in apache2.conf but I don't know what prefork.c and worker.c represent.

# prefork MPM
# StartServers ......... number of server processes to start
# MinSpareServers ...... minimum number of server processes which are kept spare
# MaxSpareServers ...... maximum number of server processes which are kept spare
# MaxClients ........... maximum number of server processes allowed to start
# MaxRequestsPerChild .. maximum number of requests a server process serves
<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
MaxClients          20
MaxRequestsPerChild  0
</IfModule>

# pthread MPM
# StartServers ......... initial  number of server processes to start
# MaxClients ........... maximum  number of server processes allowed to start
# MinSpareThreads ...... minimum  number of worker threads which are kept spare
# MaxSpareThreads ...... maximum  number of worker threads which are kept spare
# ThreadsPerChild ...... constant number of worker threads in each server process
# MaxRequestsPerChild .. maximum  number of requests a server process serves
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
0
 
elmoredanielAuthor Commented:
I saw those articles, but I don't have the background to know how best to set their values. I hope someone here does.

No thats just the part with the MaxClients setting.
0
 
savoneCommented:
You can also set the maxclients directive outside of these module configs.  

Just add MaxClients=256 somewhere in the apache2.conf file

and here is some more reading that I found interesting and useful in the past:

http://www.linuxtopia.org/online_books/mod_perl_programming_book/ch11_01.html

and also a more clear explanation of the directive:

http://www.webmasterworld.com/forum92/6188.htm

0
All Courses

From novice to tech pro — start learning today.