Basic HTTP Server hangs when running Apache Bench on it

2,474 views
Skip to first unread message

Paul Barry

unread,
Jan 22, 2010, 10:05:10 PM1/22/10
to nodejs
I have a very simple http server: http://gist.github.com/284396. It
is just the example from the web site without the 2 second delay.
When I run the server and then run apache bench on it, it hangs around
16000 requests:

$ ab -c 5 -n 20000 http://127.0.0.1:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 10000 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
apr_poll: The timeout specified has expired (70007)
Total of 16362 requests completed

This happens pretty consistently around 16000, but not the exact same
number every time. It eventually times out and then the server it
working again. Omitting the -c option from apache bench doesn't
change things. Is anyone else seeing this behavior?

Ryan Dahl

unread,
Jan 23, 2010, 3:29:28 AM1/23/10
to nod...@googlegroups.com
On Fri, Jan 22, 2010 at 7:05 PM, Paul Barry <paulj...@gmail.com> wrote:
> This happens pretty consistently around 16000, but not the exact same
> number every time.  It eventually times out and then the server it
> working again.  Omitting the -c option from apache bench doesn't
> change things.  Is anyone else seeing this behavior?

I'm not. What operating system?

Paul Barry

unread,
Jan 23, 2010, 8:04:23 AM1/23/10
to nodejs
Snow Leopard

On Jan 23, 3:29 am, Ryan Dahl <coldredle...@gmail.com> wrote:

Joe Developer

unread,
Jan 23, 2010, 8:54:48 AM1/23/10
to nod...@googlegroups.com


On Sat, Jan 23, 2010 at 8:04 PM, Paul Barry <paulj...@gmail.com> wrote:
Snow Leopard

I know it might not help you directly, but debian lenny shows no such problems.

Micheil Smith

unread,
Jan 23, 2010, 9:08:31 AM1/23/10
to nod...@googlegroups.com
I can confirm this on Mac OS X 10.6.2, using HEAD of node.

- Micheil.

> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>

Micheil Smith

unread,
Jan 24, 2010, 1:06:27 AM1/24/10
to nod...@googlegroups.com
Okay, I modified the test script slightly, to output the number of connections it's had since start, and with one ab process running, the max I could reach was about 16330-16340. However, then I opened up another ab process, and node reported out that it had just served up 32000 connections.

Here's the modified script: http://gist.github.com/285041

This leads me to think it's an issue with ab on mac os x, however, I couldn't find any such information confirming this.

- Micheil.

Isaac Z. Schlueter

unread,
Jan 24, 2010, 2:32:38 AM1/24/10
to nodejs
I just rolled back as far as v1.0.23, and the error's been present at
least that long.

It's definitely only present on OS X, afaict.

For what it's worth, the problem doesn't occur if you're using
keepalives. It seems to be related to opening the actual TCP tunnel.
If you're just benchmarking your server for performance or whatever,
you can probably throw -k on there when testing on the Mac, and get
reasonable relative results.

Just don't use a Mac for a real web server. They're much more humane
dev envs, imo, but you need a proper *nix for serving real traffic.

--i

On Jan 23, 10:06 pm, Micheil Smith <mich...@brandedcode.com> wrote:
> Okay, I modified the test script slightly, to output the number of connections it's had since start, and with one ab process running, the max I could reach was about 16330-16340. However, then I opened up another ab process, and node reported out that it had just served up 32000 connections.
>
> Here's the modified script:http://gist.github.com/285041
>
> This leads me to think it's an issue with ab on mac os x, however, I couldn't find any such information confirming this.
>
> - Micheil.
>
> On 23/01/2010, at 2:05 PM, Paul Barry wrote:
>
> > I have a very simple http server:http://gist.github.com/284396.  It
> > is just the example from the web site without the 2 second delay.
> > When I run the server and then run apache bench on it, it hangs around
> > 16000 requests:
>

> > $ ab -c 5 -n 20000http://127.0.0.1:8080/


> > This is ApacheBench, Version 2.3 <$Revision: 655654 $>

> > Copyright 1996 Adam Twiss, Zeus Technology Ltd,http://www.zeustech.net/
> > Licensed to The Apache Software Foundation,http://www.apache.org/

Reply all
Reply to author
Forward
0 new messages