httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Lynch" <>
Subject Re: [users@httpd] measure performance of a php-script with apache ab
Date Tue, 02 Jan 2007 20:46:53 GMT
On Mon, January 1, 2007 9:29 am, Stefani Gerber wrote:
> I want to measure the performance of a specific php-script. That
> script
> performs, based on session information (that I copied directly into
> that
> file for test purposes),

It's possible that the session setup/breakdown takes 2 seconds on the
first page hit, but is much faster on a reload with the same session

Seems unlikely to be that dramatic, though.

Double-check that you have the correct session info.

> some calculations and database queries. When
> I
> look at the script in a browser, it does what it should and takes
> about
> 2 seconds to finish (slow development machine). When I run the script
> with ab (ab -n 1000 -c 10 http://localhost/path/to/script.php) I get a
> measure for "requests per second" of 500-900. I asume, that no
> parsing/executing of the script is done. To check, I put in a db-write
> at the beginning of the script which writes, if the page is called in
> the browser and doesn't, if it is called by ab.

I wouldn't do that -- Keep the test valid by having it do the same
thing regardless of the environment...

If anything, check to make sure that your ab test actually IS altering
the db the way a normal visitor would.  Otherwise your test is only of
academic interest.

> Does anyone know, why the php-part is not executed when I use ab or
> where I should start off to find the problem?

I don't know ab that well, or Apache for that matter, but it should be
pretty easy in PHP to record the "hits" and be sure that PHP is

Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
Yeah, I get a buck. So?

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