You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2001/10/28 05:37:21 UTC

ApacheBench says my site is unstable?

I'm using ApacheBench to perform stress testing on my mod_perl server.
It's not always working, though. Observe the following two runs: (first is
Broken pipe; second has some failed requests)

[pmak@sg1 bin]$ ./ab -n 1000 -c 10 http://65.119.108.120:8080/
This is ApacheBench, Version 1.3c <$Revision: 1.45 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2000 The Apache Group, http://www.apache.org/

Benchmarking 65.119.108.120 (be patient)...Broken pipe

[pmak@sg1 bin]$ ./ab -n 1000 -c 10 http://65.119.108.120:8080/
This is ApacheBench, Version 1.3c <$Revision: 1.45 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2000 The Apache Group, http://www.apache.org/

Server Software:        Apache/1.3.22
Server Hostname:        65.119.108.120
Server Port:            8080

Document Path:          /
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   21.109 seconds
Complete requests:      1000
Failed requests:        22
   (Connect: 0, Length: 22, Exceptions: 0)
Total transferred:      196578 bytes
HTML transferred:       12714 bytes
Requests per second:    47.37
Transfer rate:          9.31 kb/s received

Connnection Times (ms)
              min   avg   max
Connect:       99   101   140
Processing:     5   107   364
Total:        104   208   504

Whenever I try to load that URL in my browser, it works so I think it has
something to do with the performance of httpd under load:

[pmak@sg1 bin]$ lynx -dump http://65.119.108.120:8080/

   Hello, world!

Looking in my access_log, I see failed requests like this:

66.33.60.115 - - [25/Oct/2001:22:20:43 -0700] "GET / HTTP/1.0" 200 0 "-" "ApacheBench/1.3d"

and successful requests like this:

66.33.60.115 - - [27/Oct/2001:21:31:32 -0700] "GET / HTTP/1.0" 200 13 "-" "ApacheBench/1.3c"

Does anyone have an idea what's going on? I can't figure out why some
requests seem to return 0 bytes at random, or why ApacheBench crashes with
"Broken pipe". There is nothing in the VirtualHost or the serverwide error
log other than the MaxClients warning:

66.33.60.115 - - [27/Oct/2001:21:31:32 -0700] "GET / HTTP/1.0" 200 13 "-" "ApacheBench/1.3c"

MaxClients is set to 50, btw.

server1# uname -a
FreeBSD server1.buildreferrals.com 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Fri Oct 12 13:36:14 PDT 2001
root@test23.tesys.com:/usr/src/sys/compile/LOCAL  i386

Apache version 1.3.22, mod_perl verison 1.26

Is there a quirk of FreeBSD that I have to account for, perhaps? This is
my first time setting up Apache on a FreeBSD system (I've always used Red
Hat Linux or SunOS before).


Re: ApacheBench says my site is unstable?

Posted by Stas Bekman <st...@stason.org>.
Philip Mak wrote:

> I'm using ApacheBench to perform stress testing on my mod_perl server.
> It's not always working, though. Observe the following two runs: (first is
> Broken pipe; second has some failed requests)
> 
> [pmak@sg1 bin]$ ./ab -n 1000 -c 10 http://65.119.108.120:8080/
> This is ApacheBench, Version 1.3c <$Revision: 1.45 $> apache-1.3
> Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Copyright (c) 1998-2000 The Apache Group, http://www.apache.org/
> 
> Benchmarking 65.119.108.120 (be patient)...Broken pipe


That's not-unusual, I saw this too when creating a heavy load. May be 
you should try to get the latest ab version, I know there were quite a 
few changes recently. I'd suggest trying the one in the 2.0 tree.


In any case you may want to ask this question at the httpd list, since 

it seems to be the client's problem, not the server's one.


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: ApacheBench says my site is unstable?

Posted by Philip Mak <pm...@aaanime.net>.
On Mon, 29 Oct 2001, Joshua Chamas wrote:

> > Complete requests:      1000
> > Failed requests:        22
> >    (Connect: 0, Length: 22, Exceptions: 0)
>
> If ApacheBench complains about length problems, it means
> that the length of subsequent requests differs from the
> output length of the first request, so dynamic content usually
> screws up ab's response in this way.

I thought about that, but the test script just prints "Hello world" every
time (static length). The failed requests got 0 bytes, according to the
access_log.

I haven't figured out this problem yet, but I'm hoping it's a problem with
ab (after all, it really shouldn't just crash with "Broken pipe" like
that...).


Re: ApacheBench says my site is unstable?

Posted by Joshua Chamas <jo...@chamas.com>.
Philip Mak wrote:
>
> Time taken for tests:   21.109 seconds
> Complete requests:      1000
> Failed requests:        22
>    (Connect: 0, Length: 22, Exceptions: 0)
> Total transferred:      196578 bytes
> HTML transferred:       12714 bytes
> Requests per second:    47.37
> Transfer rate:          9.31 kb/s received
>

If ApacheBench complains about length problems, it means
that the length of subsequent requests differs from the 
output length of the first request, so dynamic content usually
screws up ab's response in this way.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Re: [OT] pdf creation

Posted by Mike808 <mi...@users.sourceforge.net>.
Dave Baker wrote:
> I ended up using htmldoc (http://www.easysw.com) which does html->pdf in a
> breeze (as well as html->ps).

So does HTML2PS, which is also GPL'd, and written in 100% Perl. Ghostscript or
the Acrobat reader can do the PS2PDF output.
See http://www.tdb.uu.se/~jan/html2ps.html

Mike808/
-- 
perl -le "$_='7284254074:0930970:H4012816';tr[0->][ BOPEN!SMUT];print"

Re: [OT] pdf creation

Posted by Dave Baker <da...@dsb3.com>.
> Does anyone have success/horror stories generating pdf files under 
> mod_perl?
> Recommendations?
>

No horror stories except trying to go about it the wrong way a few times
and ended up with multi-hundred megabyte TIFF files as intermediate steps.

I ended up using htmldoc (http://www.easysw.com) which does html->pdf in a
breeze (as well as html->ps).  Handy if you want to pdfify something that
you've already rendered into HTML for online display.

Dave

-- 

- Dave Baker  :  dave@dsb3.com  :  dave@devbrain.com  :  http://dsb3.com/ -
GnuPG:  1024D/D7BCA55D / 09CD D148 57DE 711E 6708  B772 0DD4 51D5 D7BC A55D


Re: [OT] pdf creation

Posted by John Armstrong <si...@siberian.org>.
I once did a project using html2pdf under Unix. It worked great for 
converting the Human Resources forms ( in html ) to printable PDF's that 
contained variable user information.

Worked well and did not cause any real trouble.

John-

On Sunday, October 28, 2001, at 04:29 PM, Drew Taylor wrote:

> At 04:01 PM 10/28/2001 -0600, Lon Koenig wrote:
>> I apologize for the OT post, but the members of this list seem to be 
>> authoritive resource for all web/perl solutions.
>>
>> I'm currently bidding a project, and the client's all in favor of a 
>> mod_perl solution. Phase 2 of the project requires on-the-fly pdf 
>> creation.
>>
>> Does anyone have success/horror stories generating pdf files under 
>> mod_perl?
>> Recommendations?
>
> I've used PDFLib for several projects, and it works wonderfully. The 
> core is written in ANSI C with interfaces for every popular language. 
> It's not free, but it does a lot and works very well.
> http://www.pdflib.com/
>
>
> Drew Taylor                     JA[P|m_p|SQL]H
> http://www.drewtaylor.com/      Just Another Perl|mod_perl|SQL Hacker
> mailto:drew@drewtaylor.com      *** God bless America! ***
> ICQ: 135298242
>
>
>
>


Re: [OT] pdf creation

Posted by Drew Taylor <dr...@drewtaylor.com>.
At 04:01 PM 10/28/2001 -0600, Lon Koenig wrote:
>I apologize for the OT post, but the members of this list seem to be 
>authoritive resource for all web/perl solutions.
>
>I'm currently bidding a project, and the client's all in favor of a 
>mod_perl solution. Phase 2 of the project requires on-the-fly pdf creation.
>
>Does anyone have success/horror stories generating pdf files under mod_perl?
>Recommendations?

I've used PDFLib for several projects, and it works wonderfully. The core 
is written in ANSI C with interfaces for every popular language. It's not 
free, but it does a lot and works very well.
http://www.pdflib.com/


Drew Taylor                     JA[P|m_p|SQL]H
http://www.drewtaylor.com/      Just Another Perl|mod_perl|SQL Hacker
mailto:drew@drewtaylor.com      *** God bless America! ***
ICQ: 135298242





Re: [OT] pdf creation

Posted by Igor Sysoev <is...@rambler-co.ru>.
On Wed, 31 Oct 2001, Wim Kerkhoff wrote:

> Steve Smith wrote:
> > 
> > simran  writes:
> > > I believe there is also a Content-disposition tag you can use to
> > > tell the browser what to name the file...
> > 
> > As mentioned below in my original post, it doesn't work in all
> > browsers.
> 
> Like you say, PATH_INFO works for many browsers. I ran into issues with

It works for any browser. Browser doesn't no anything about PATH_INFO.

> IE not using it properly... I ended up having to tack "&MYPDFFILE.pdf"
> onto the end of the URI, just so that it would use the correct
> extension. Something to try perhaps. e.g.:
> 
> http://server/perl/pdfgen.pl/MYPDFFILE.pdf?&MYPDFFILE.pdf
> 
> In my case, I had to do this trick to get *.exe files to download as
> *.exe instead of *.com.

Why do you use "?&MYPDFFILE.pdf" ? I think that

http://server/perl/pdfgen.pl/MYPDFFILE.pdf

would be enough for MSIE.

Igor Sysoev


Re: [OT] pdf creation

Posted by Wim Kerkhoff <wi...@merilus.com>.
Steve Smith wrote:
> 
> simran  writes:
> > I believe there is also a Content-disposition tag you can use to
> > tell the browser what to name the file...
> 
> As mentioned below in my original post, it doesn't work in all
> browsers.

Like you say, PATH_INFO works for many browsers. I ran into issues with
IE not using it properly... I ended up having to tack "&MYPDFFILE.pdf"
onto the end of the URI, just so that it would use the correct
extension. Something to try perhaps. e.g.:

http://server/perl/pdfgen.pl/MYPDFFILE.pdf?&MYPDFFILE.pdf

In my case, I had to do this trick to get *.exe files to download as
*.exe instead of *.com.

In the couple of PDF scripts that I have written, I used other modules
to create a PostScript or PNG file, then used a system call to convert
it to a PDF.  For something that isn't being used very often this should
be acceptable. Once its a PDF on the system, the file can read in and
printed to STDOUT or a redirect to http://server/tmpfiles/$randomtmpfile
can be done.

-- 

Regards,

Wim Kerkhoff, Software Engineer
Merilus, Inc.  -|- http://www.merilus.com
Email: wim@merilus.com

RE: [OT] pdf creation

Posted by Steve Smith <st...@isay.com.au>.
simran  writes:
> I believe there is also a Content-disposition tag you can use to
> tell the browser what to name the file...

As mentioned below in my original post, it doesn't work in all
browsers.

Steve

RE: [OT] pdf creation

Posted by simran <si...@sitesuite.org>.
I believe there is also a Content-disposition tag you can use to tell the 
browser what to name the file... 

http://www.faqs.org/rfcs/rfc2183.html







-----Original Message-----
From: Steve Smith [mailto:steve.smith@isay.com.au]
Sent: Monday, 29 October 2001 9:56 AM
To: Lon Koenig
Cc: modperl@apache.org
Subject: Re: [OT] pdf creation


> Does anyone have success/horror stories generating pdf files under
> mod_perl?  Recommendations?

I recently built a customer billing system system that generated PDF
invoices using Latex + Template-Toolkit.  See 

  http://template-toolkit.org/docs/blue/Manual/Filters.html

This was an backend system, but the files could easily be generated
online by simply wrapping the template processor in a handler with the
appropriate Content-Type: headers.

Tip: Although the Content-Disposition: header is supposed to tell the
browser the appropriate filename for the file, this doesn't actually
work in most browsers.  The solution is to extend the URL past the
handler/script, e.g. :

    http://server/perl/pdfgen.pl/MYPDFFILE.pdf

Apache will dispatch this to pdfgen.pl, but the browser will assume
the default filename is MYPDFFILE.pdf.

Hope this helps,
Steve


Re: [OT] pdf creation

Posted by Steve Smith <st...@isay.com.au>.
> Does anyone have success/horror stories generating pdf files under
> mod_perl?  Recommendations?

I recently built a customer billing system system that generated PDF
invoices using Latex + Template-Toolkit.  See 

  http://template-toolkit.org/docs/blue/Manual/Filters.html

This was an backend system, but the files could easily be generated
online by simply wrapping the template processor in a handler with the
appropriate Content-Type: headers.

Tip: Although the Content-Disposition: header is supposed to tell the
browser the appropriate filename for the file, this doesn't actually
work in most browsers.  The solution is to extend the URL past the
handler/script, e.g. :

    http://server/perl/pdfgen.pl/MYPDFFILE.pdf

Apache will dispatch this to pdfgen.pl, but the browser will assume
the default filename is MYPDFFILE.pdf.

Hope this helps,
Steve

[OT] pdf creation

Posted by Lon Koenig <lo...@schnoggo.com>.
I apologize for the OT post, but the members of this list seem to be 
authoritive resource for all web/perl solutions.

I'm currently bidding a project, and the client's all in favor of a 
mod_perl solution. Phase 2 of the project requires on-the-fly pdf 
creation.

I've done page layout in other languages, so I'm not too concerned 
about coding the thing. My question is:

Does anyone have success/horror stories generating pdf files under mod_perl?
Recommendations?


-- 
. . . . . . . . . . . . . . . . . . . . . . . .
Lon Koenig Consulting          lon@mediagods.com
(612) 965-6305                 http://www.schnoggo.com

Re: [OT] ApacheBench says my site is unstable?

Posted by Andrew Ho <an...@tellme.com>.
Hello,

PM>I'm using ApacheBench to perform stress testing on my mod_perl server.
PM>It's not always working, though. Observe the following two runs: (first
PM>is Broken pipe; second has some failed requests)

Try writing a Perl (or other language) client that hits the URL you test
over and over again to inspect what is actually returned to the client at
any given time. For example, just use LWP::Simple to GET that URL over and
over again, and save the result (for example) in a hash and report all the
different variations you get. Perhaps your script fails sporadically, not
core dumping, but returning no headers or similarly confusing a regular
HTTP client.

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                   info@tellme.com          Voice 650-930-9062
Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101
----------------------------------------------------------------------