httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: [PATCH] Solaris sockets for support/ab.c (httpd-2_0_32-beta)
Date Wed, 13 Mar 2002 17:09:43 GMT
"Martin Ramshaw" <> writes:

> > On Wed, 13 Mar 2002 04:18:00AM -0800, Justin Erenkrantz wrote:
> > >On Wed, Mar 13, 2002 at 07:05:45AM -0500, Jeff Trawick wrote:
> > > > "Martin Ramshaw" <> writes:
> > > >
> > > > By default, Solaris (at least, Solaris 7 for sparc) restricts the
> number of
> > > > file
> > > > handles that may be used. See the comments in the attached patch file
> for
> > > > more details.
> > >
> > > Lots of Unix-ish systems work the same way.
> > >
> > > Personally, I think it is better if you put "ulimit -n unlimited" in
> > > your shell init script rather than adding the logic to ab.
> >
> > Yup, my thoughts too.  -- justin (wondering why I'm still up)
> I see.
> So if I want to use 'ab' in a meaningful way on a 'Unix-ish system'
>     I should write a shell wrapper script.

That is not true in general.  Plenty of people use ab on Unix and I've
never heard a complaint about not being able to get enough file

Anyway, I didn't mean a shell wrapper script.  I mean that you
could/should put "ulimit -n unlimited" in your

> Is it just me, or does that sound kind of lame ?

Some thoughts:

The operating system has tools to adjust resource limits.  Why should
Apache and its support code duplicate that work?  We can't do a better
job than the OS and we end up with more code to maintain, most of it

If somebody wants to use ab to pound on a server with many concurrent
connections, getting ab enough file descriptors is only one of their
problems.  Here are some others that they may or may not encounter
depending on their OS and how they have changed the defaults:

1) configure enough file descriptors for the server (Apache has no
   such logic to adjust ulimit)

2) configure enough ephemeral ports on the client stack (on many OSs
   with the default configuration you can't run ab very long before ab
   can no longer connect to the server)

3) disable SYN attack code on the server stack so it doesn't get upset
   that so many SYNs for the same server port are coming from the same

4) configure enough mbufs on the client stack so that the stack can
   actually create as many sockets as you are telling ab that it needs
   (on my FreeBSD 3.4 box I ended up recompiling the kernel to achieve
   this :( )

If Apache and support utilities have logic to adjust resource limits,
developers can no longer adjust soft limits to force error paths.
(There are always hard limits; by changing soft limits and not
having Apache undo our change, we can easily simulate reaching the
hard limit.)

I hope this helps understand the big picture (at least as I see it).

Jeff Trawick |
Born in Roswell... married an alien...

View raw message