[httperf] The glibc FD_SETSIZE problem and a solution
Jesse Byler
lists.httperf at web19.eml.cc
Mon Nov 28 14:34:44 PST 2005
First of all, for httperf users who haven't found it, Julian T J
Midgley's http performance tutorial at
http://xenoclast.org/doc/benchmark/ is an invaluable supplement to
the httperf documentation, as it provides explanations for how to
interpret httperf output and how to determine if the output is valid,
as well as a program autobench which wraps httperf to provide the
ability to run a series of tests and graph the results.
I ran into problems when trying to implement Julian's recommendations
at
http://xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/node7.html
for tuning file descriptor limits on Linux. The problem is that
increasing the file descriptor limit (either as Julian describes or
by using the bumpfdrun wrapper at
http://developers.sun.com/solaris/articles/polling_efficient_bumpfdrun.c )
doesn't buy you much with a stock httperf, because httperf-0.8
notices that the number of file descriptors is bigger than it can
hold in an fdset (FD_SETSIZE) and complains:
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of
open files to FD_SETSIZE
Thus a stock httperf-0.8 doesn't take advantage of the increased file
descriptor limit. My clunky solution was to recompile the entire
libc with a new FD_SETSIZE and link httperf with this modified libc.
Julian has a much simpler solution - hack httperf ("simply take a
copy of the fd_set struct definition in sys/select.h, change the name
of the struct, set a large FD_SETSIZE and slap it into a header file
that you include wherever necessary in httperf's source"). He
provided me with a patch that does exactly that.
The attached patch file (from Julian T J Midgley, submitted here by
permission - thanks Julian!) should apply against a clean httperf-0.8
tree:
cd httperf-0.8; patch -p1 < /tmp/fix_fd_setsize.patch
Optionally set LOCAL_FD_SETSIZE in the new file fd_set.h as required
(it defaults to 102400, which is likely to be high enough for most
purposes), rebuild, and the patched httperf does not suffer from the
glibc FD_SETSIZE limitation.
While we're in the business of patching the httperf-0.8 source, I'll
include another minor patch which fixes the ./configure problem where
httperf likes to install into /bin instead of $prefix/bin. If there
are any httperf maintainers on this list, perhaps the two patches
could be incorporated into an httperf-0.9 release?
Thanks,
Jesse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_exec_prefix.patch
Type: text/x-diff
Size: 338 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/httperf/attachments/20051128/93ca3f44/fix_exec_prefix.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_fd_setsize.patch
Type: text/x-diff
Size: 3208 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/httperf/attachments/20051128/93ca3f44/fix_fd_setsize.bin
More information about the httperf
mailing list