httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Galić <>
Subject Re: [users@httpd] debugging websites running on Apache?
Date Fri, 19 Nov 2010 13:39:50 GMT

----- "Tomasz Chmielewski" <> wrote:

> How do you debug websites running on Apache?
> Say, you have a website which is dog slow on the powerful server.

If your website is static, and is dog slow although running on
a powerful server, you're doing it wrong.

> My favourite way (after checking the obvious errors from the logs) was
> to simply run Apache through strace, which would print where httpd 
> processes connect to (and possibly hang, while waiting for a 
> connection), what SQL queries they do, what files they try to open, 
> where they write to etc.

If it's dynamic and is dog slow, it's usually because of the
web application (I prefer to call it application, not site in
this case so you can easily distinguish it.)

What you want is a profiler for your environment. With PHP you
have for instance: Xdebug:

For mod_perl there's Apache::DProf (but I have no
experience with it)

> This is great as it lets you see pretty everything which happens on
> the 
> system, but has one major drawback: if anyone but you is using the 
> webserver, you'll get a lot of noise in strace output - so debugging 
> with strace is really only useful if you're the only user, which
> doesn't 
> make it a great debugging tool on a busy webserver.
> What are other debugging methods which can be used on a busy
> webserver? 
> Ideally, I'd like to see all connections, database queries, files
> opened 
> for read/write by Apache processes, with timestamps, as I connect from
> a 
> given IP address (so all other noise is excluded).

Even with strace you can reduce the amount of syscalls you see.
Check strace(1) for the -e option.

If you're on a modern Operating System, you'll have something like
DTrace or SystemTap in place, which is a big plus, as it ads almost
no overhead to your actions, and could be considered monitoring.

If you're on a DTrace aware platform, there's mod_dtrace!
(I haven't looked into porting mod_dtrace such that it will
work with SystemTap, but it shouldn't be too hard.)

> -- 
> Tomasz Chmielewski


Igor Galić

Tel: +43 (0) 664 886 22 883

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message