wwwolf Posted November 22, 2008 Share Posted November 22, 2008 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. Quote Link to comment Share on other sites More sharing options...
kevintynfron Posted November 27, 2008 Share Posted November 27, 2008 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 Quote Link to comment Share on other sites More sharing options...
alluoshi Posted November 27, 2008 Share Posted November 27, 2008 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. Quote Link to comment Share on other sites More sharing options...
wwwolf Posted November 28, 2008 Author Share Posted November 28, 2008 Thanks for your help guys! I'll take a look at ExtendedStatus and server-status, with any luck they might give me an idea what to look for. Quote Link to comment Share on other sites More sharing options...
wwwolf Posted December 2, 2008 Author Share Posted December 2, 2008 I watched Apache via server-status over the weekend, and of course nothing went wrong... Could you point me towards how to switch Apache to prefork? I think I'll give that a try and see what happens. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.