On 28 Nov 2000, Joe Schaefer wrote:

> Stas Bekman <[EMAIL PROTECTED]> writes:
> 
> > Before trying to answer your question, let me ask you another
> > question. What's the average run time of you mod_perl scripts? Is it 2 to
> > 5 msecs? Or is it 0.5 to 1 sec? If you are in the former range this
> > question makes sense, well may be. If you are in the latter range, you are
> > wasting your time.
> 
> I disagree, naturally ;).  With respect to the effectiveness of keepalives,
> there are many factors that come into play - not least of which are your 
> own site design and consideration of the effects of TCP slow start.  Long
> story short, IMHO there is no way to distill a universal answer for whether 
> one should or should not enable http keepalives.
> 
> For the servers I manage, the effect of enabling keepalives on the browser-
> proxy connection is quite significant.  Over DSL connection to a live site
> situated thousands of miles away (20+hops), here's my apachebench stats:
> 
> 
> % ./ab -n 500 -c 10 http://front.end/proxied/to/backend/content_handler
> 
> (The mod_perl content handler here grabs content from a mysql server
> via DBI - it is decidedly non-trivial :)
> 
> ...
> 
> Document Length:        1807 bytes
> 
> Concurrency Level:      10
> Time taken for tests:   21.539 seconds
> Complete requests:      500
> Failed requests:        0
> Total transferred:      995500 bytes
> HTML transferred:       903500 bytes
> Requests per second:    23.21
> Transfer rate:          46.22 kb/s received
> 
> Connnection Times (ms)
>               min   avg   max
> Connect:       60   129  3064
> Processing:   107   298   250
> Total:        167   427  3314
> 
> Same URL with keep-alives enabled:
> 
> % ./ab -k -n 500 -c 10 http://front.end/proxied/to/backend/content_handler
> 
> ...
> 
> Document Length:        1807 bytes
> 
> Concurrency Level:      10
> Time taken for tests:   15.047 seconds
> Complete requests:      500
> Failed requests:        0
> Keep-Alive requests:    500
> Total transferred:      1014010 bytes
> HTML transferred:       903500 bytes
> Requests per second:    33.23
> Transfer rate:          67.39 kb/s received
> 
> Connnection Times (ms)
>               min   avg   max
> Connect:        0     1    93
> Processing:    99   295  2507
> Total:         99   296  2600
> 

This is not a real world benchmark. It may generate the real world
load, but not the real world usage. And once you realize that this
cool speedup that you show doesn't really happen.

User requests a single page at a time. The connection is tied to the
browser. User will not issue a new request in the same rate as ab
does. I'd say it takes at least 5-10 secs for user to read the page
and you don't want to keep the mod_perl server tied all this time
doing nothing. Even the front-end server, since you will end up with
thousands of front-end servers if you will use a big KeepAlive.

> Any way you slice it, that is a _huge_ difference!  You just have
> to test the effects yourself to see if it keepalives are worth
> running on your server.

That's true, my point was the same -- check your numbers and see
whether it helps or not. Definitely not with ab or any other benchmark
tool.



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to