On Wed, Jun 16, 2010 at 12:16 PM, Jakov Sosic <jakov.so...@srce.hr> wrote:

> On 06/16/2010 06:49 AM, Scott Gifford wrote:
> > On Tue, Jun 15, 2010 at 5:33 PM, Jakov Sosic <jakov.so...@srce.hr
> > <mailto:jakov.so...@srce.hr>> wrote:
> >
> >     I'm interested in measuring I/O that all apache processes are
> >     generating.
> >
> >
> > I used mod_logio to solve a similar problem not too long ago, with good
> > success:
>
> But it seems that this module records network I/O and not the filesystem
> I/O. Although it's good to know this too, I would prefer more the
> filesystem I/O currently :)
>

Ah, I see.  I haven't done that before, but I can offer random suggestions.
 :-)

You probably know this already, but if Apache is the main or only thing
running on this server, tools like iostat and sar can get the information
you are after on a system-wide basis.  That would be by far the easiest
solution.

Otherwise, if you need to isolate Apache from other parts of the system, it
looks like the information you are after is in /proc/PID/io on Linux.  You
could find all of Apache's PIDs, poll this information periodically, log it,
then calculate usage/second over your log interval.  Tools like mrtg are
designed to manage this sort of data.  iotop might be helpful too.  You
could probably also install some custom request handlers from a module or
mod_perl (in a 
PerlLogHandler<http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler>or
PerlCleanupHandler<http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler>)
to read this file and record the I/O increase after every request.  This
might help work around your concern about PIDs changing.

Those are the places I would start at least.  Hope this is helpful,

-----Scott.

Reply via email to