4

I have an Apache server which is hanging for some reason. When I normally want to check on the load of an Apache server, I tend to use mod_status via the URL at http://webserver1.example.org/server-status or from the commandline like service httpd fullstatus.

However today, the Server is refusing all new connections. Some mysterious problem is causing connections to stall, which means that number of connections fills up all available connections (e.g. The number of connects exceeds the MaxClients setting), and therefore neither http://webserver1.example.org/server-status nor service httpd fullstatus can return anything.

Is it possible to configure Apache to reserve one or two slots for the mod_status pages?

  • 1
    You could kill one of httpd processes and immediately try to get status. – Tometzky Nov 7 '13 at 21:14
  • Great idea! Unfortunately even something like kill PID && service httpd fullstatus is failing to grab the status. – Stefan Lasiewski Nov 7 '13 at 21:45
  • You may want to wait a second before trying. Sending a signal does not immediately end a process. Also check if this process really exited. – Tometzky Nov 7 '13 at 22:24
  • I also tried waiting a second or more. In the logfile I see that another request from elsewhere was accepted over mine, so maybe it's just a crapshoot and if I tried enough times I'll eventually get the session. – Stefan Lasiewski Nov 7 '13 at 23:03
2

Please see this related question and the linked answer by @covener. There are two options you could take to approach your problem.

  1. check mod_backdoor (description and source) which provides a special port offering the scoreboard, even when all slots are in use.
  2. Use a ScoreBoardFile which provides the scoreboard via shared memory. You will have to use a tool (i.e. Apache2-ScoreBoardFile or ftss) to parse the binary data though.

Both solutions are quite involved but with option 2 allowing even realtime access due to shared memory.

Additionally I opened a bug report at apache bugzilla.

0

The number of connects exceeds the MaxClients setting

If this isn't being caused by high traffic to the server or a MaxClients setting that's way too low (the defaults are usually fine), then the problem is probably being caused outside of Apache, which server-status won't help troubleshoot much.

That said, I've seen the exact behavior you're describing happen when the root filesystem is out of free space. Try a df -h to see if you're out of disk space.

  • /server-status is just a convenient tool which lets me see which the client IP, HTTP request, path, and various performance statistics. While much of that info is already availalbe in the logs, logs don't provide a quick glance at a server's health, I like the convenience of a command like service httpd fullstatus. – Stefan Lasiewski Nov 7 '13 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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