How's my server doing?

By Jeremy Reed (Send Email)
Posted Dec 21, 2000


In this article, I'll talk about using mod_status and mod_info to tell you how your server is performing right now.

What sort of information can I get?

In this article, I'll talk about using mod_status and mod_info to tell you how your server is performing right now.

Using mod_status, you can tell who is looking at what on your server right now. You can tell how many people are on the web site right now. And you can see other things that may not be of particular interest to your customer, but is useful to you as the site administrator.

Customers love this stuff

I don't know how your customers are, but my customers like information. How much information? More information. Up-to-the-minute information. Detailed information. Daily reports are not good enough, because by the end of the day, it's already too late. They want to know what's going on right now.

In fact, I have one customer who ... well, I suppose I shouldn't say anything more. After all, he might actually read my column.

Anyways, the point is, customers love this sort of thing. By giving them this sort of detailed information, at the cost of a few configuration changes, you are the hero and it looks like you did a lot of work for it. Don't worry. I won't tell.

mod_info and mod_status

There are two modules that I'll talk about in this column. They give you two rather different types of information, but they are both very handy.

mod_info tells you about your server: how it was built, and how it's configured.

mod_status tells you exactly what your server is thinking about right now.

mod_status

mod_status is the more exciting of the two modules. You can watch what folks are looking at on your site, how many child processes are running, and what those processes are doing.

If you did a default build of Apache, you will have mod_status installed, and all that you will have to do is add the following lines to your configuration file. (Actually, you will probably find them already there, commented out.)


     # Server status
     <Location /server-status>
         SetHandler server-status
         Order deny,allow
         Deny from all
         Allow from .your_domain.com
     </Location>

The SetHandler directive tells Apache that when it receives a request that matches the specified context (in this case, a location matching /server-status, that instead of looking in that directory for a file, it should rather pass control over to the specified handler, which is usually provided by a module or by a CGI (or similar) process.

The mod_status module defines a handler (server-status) and one directive (ExtendedStatus).

With the configuration above, accessing the resource /server-status will present you with a summary of server activity as of right now. You'll get a representation of how many servers you have running (child processes) and how this relates to your maximum number of servers, which you set with MaxClients.

This will look something like:

     W_________......................................................
     ................................................................
     ................................................................
     ................................................................

Page 1 of 3


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.