Jump to content

Information on Apache threads?


wwwolf

Recommended Posts

Hello,

I'm fairly new to Apache and have a problem that's been stumping me for months.  I'm trying to get a small/mid-sized Joomla site with some custom code up and running, but after about 8 hours it always crashes with PHP errors.

I've noticed that if I up the ThreadsPerChild count in httpd.conf I can keep the site going for 24 or 48 hours.

Does anyone know of a way to look at what Apache's threads are doing? I'm fairly sure it's some of my code that's causing the issue, but I have no way to see where/how the threads are getting locked up.

 

Any response would be appreciated, this has been driving me nuts, thanks.

Link to comment
https://forums.phpfreaks.com/topic/133781-information-on-apache-threads/
Share on other sites

Hi there,

Have you looked at the server status directive for apache?

 

If you've changed the ThreadsPerChild, then I assume you've no problem editing httpd.conf. You're using the worker module, and I'm using the prefork module to achieve the same kind of thing, so I assume server-status will return something similar.

 

http://www.apache.org/server-status shows what to expect. This has extended status on.

 

Here's the code from my server.

 

<Location /server-status>
  SetHandler server-status
  AuthType Basic
  AuthName "System Status"
  AuthUserFile /var/www/vhosts/example.co.uk/.htpasswd
  Require valid-user
</Location>

 

I'm using the password authentication because I can't guarantee my IP address like they use in the examples.

 

You don't need to have the viewing restrictions, but I thought it was a good idea not to be broadcasting the workings of the server to the world.

 

Hope this helps,

Kevin

 

 

go to http://localhost/server-status.html but enable the ExtendedStatus first. There you can see the cpu usage of each child process. If you are working with "worker" module, that means each child process can serve many clients (through threads). At least you can have an idea about what's going on on your server.

If you want to avoid using threads, you can use the prefork module instead of worker.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.