You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Matt Ellison <ma...@core-comm.com> on 2001/06/13 01:48:57 UTC

Just a few questions...

Hello all,

I just joined this list, as my company is beginning to make use of mod_perl
in a production e-commerce environment.  We have been converting several of
our heaviest hit CGI's to object-oriented module libraries and mod_perl
modules, with pretty good success so far.  So far, we have a few CGI's that
have been converted, and everything runs MUCH faster now.  However, when
testing with Apache Bench, a few odd things happen:

(snip)

Document Length:        30649 bytes

Concurrency Level:      10
Time taken for tests:   50.441 seconds
Complete requests:      1000
Failed requests:        489
   (Connect: 0, Length: 489, Exceptions: 0)
Total transferred:      30982005 bytes
HTML transferred:       30823749 bytes
Requests per second:    19.83
Transfer rate:          614.22 kb/s received

There are a couple slightly different versions of this program.  The current
version has been tuned to cache everything it does in hashes per iteration
through the handler sub - database queries, reading of HTML templates, etc.
Suddenly (with no changes in the $r->print statements) I'm getting this
enormous "failure" rate.  I have seen the percentage of "Failed Requests" be
as high as 75%, but we can't seem to figure out why.

Something tells me that this isn't really a problem with our program.  While
I hammer it with ab, I get perfect pages every time (in every browser you
can think of.)  I read some discussion on archives of this list about using
length() on a pre-built string to determine what should go into the
Content-Length header, but this seems silly - especially if you need the
page to interact with the browser dynamically (as in calling JavaScript
functions on the fly as the output is being generated.)

Can anyone shed some light on exactly what is happening with ab here?  I
have verified that there is no Content-Length header in the output via
telnet to the Apache server, but how safe is it to omit this header?  Why is
the results with ab inconsistent?

Thanks,

Matt E.


Re: Just a few questions...

Posted by Thomas Eibner <th...@stderr.net>.
On Tue, Jun 12, 2001 at 07:48:57PM -0400, Matt Ellison wrote:

> There are a couple slightly different versions of this program.  The current
> version has been tuned to cache everything it does in hashes per iteration
> through the handler sub - database queries, reading of HTML templates, etc.
> Suddenly (with no changes in the $r->print statements) I'm getting this
> enormous "failure" rate.  I have seen the percentage of "Failed Requests" be
> as high as 75%, but we can't seem to figure out why.
> 
> Something tells me that this isn't really a problem with our program.  While
> I hammer it with ab, I get perfect pages every time (in every browser you
> can think of.)  I read some discussion on archives of this list about using
> length() on a pre-built string to determine what should go into the
> Content-Length header, but this seems silly - especially if you need the
> page to interact with the browser dynamically (as in calling JavaScript
> functions on the fly as the output is being generated.)

http://www.mail-archive.com/modperl@apache.org/msg18544.html

Might be the answer to why your ab 'fails' some times.

> Can anyone shed some light on exactly what is happening with ab here?  I
> have verified that there is no Content-Length header in the output via
> telnet to the Apache server, but how safe is it to omit this header?  Why is
> the results with ab inconsistent?

The Content-Length header is necessary if you want keep-alive connections to
work.

-- 
  Thomas Eibner <http://thomas.eibner.dk/> - DnsZone <http://dnszone.org/>
  mod_pointer <http://stderr.net/mod_pointer>