Increasing httperf maximum number of open descriptors from 1024 to 65535

By default httperf on Linux compiles with 1024 open descriptors and that can be a problem when you plan to test high bandwidth and many concurrent connection web servers.

For safety you can edit /etc/security/limits.conf however you will also need to change the following file before you compile httperf software:

/usr/include/bits/typesizes.h

and find the following line:

/* Number of descriptors that can fit in an `fd_set’. */
#define __FD_SETSIZE 1024

and replace it to

#define __FD_SETSIZE 65535

Now you can compile httperf.
The original string that’s displayed when you run httperf without editing typesizes.h definition file:

httperf: maximum number of open descriptors = 1024

What you need is:

httperf: maximum number of open descriptors = 65535

If you see open descriptors value 65535 you can start testing your web servers.

Ps. don’t forget to install openssl-devel and libevent-devel packages before you start compiling httperf software.


Comments

  1. deltag says:

    Hi, thanks for your guide.
    I tried to do it on a Ubuntu 12.04 and httperf 0.9.0 but as I start a high load test with httperf I get this:

    *** buffer overflow detected ***: httperf terminated
    ======= Backtrace: =========
    /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f88b8703807]
    /lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7f88b8702700]
    /lib/x86_64-linux-gnu/libc.so.6(+0x10a7be)[0x7f88b87037be]
    httperf[0x404054]
    httperf[0x4050cf]
    httperf[0x406993]
    httperf[0x406c11]
    httperf[0x4063df]
    httperf[0x405283]
    httperf[0x40285e]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f88b861a76d]
    httperf[0x4038f1]

    the httperf command was this:
    httperf –server 192.168.1.59 –port 80 –num-conns 90000 –rate 500 –method GET –uri “/rubis/servlet/SearchItemsByCategory?category=3&categoryName=Business%2C+Office+%26+Industrial” –hog

    What am I doing wrong?

    Thank you!

  2. Thiago says:

    I had a very similar issue but instead of a fixed uri, i used a wsessionlog parameter in order to use the session support.

    I’m using ubuntu 14.04 and the same code used to compile for debian svn://svn.debian.org/collab-maint/deb-maint/httperf/trunk/

    httperf –client=0/1 –server=governador –port=80 –uri=/ –rate=2000 –send-buffer=4096 –recv-buffer=16384 –wsesslog=2000,0.000,sessionlog
    *** buffer overflow detected ***: ./httperf terminated
    ======= Backtrace: =========
    /lib/x86_64-linux-gnu/libc.so.6(+0x73f1f)[0x7fa5e67c5f1f]
    /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fa5e685d82c]
    /lib/x86_64-linux-gnu/libc.so.6(+0x10a6f0)[0x7fa5e685c6f0]
    /lib/x86_64-linux-gnu/libc.so.6(+0x10b777)[0x7fa5e685d777]
    ./httperf[0x403999]
    ./httperf[0x404387]
    ./httperf[0x40841f]
    ./httperf[0x40886e]
    ./httperf[0x406d1f]
    ./httperf[0x406e4b]
    ./httperf[0x4062f1]
    ./httperf[0x4059c1]
    ./httperf[0x4047d2]
    ./httperf[0x4022a9]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fa5e6773ec5]
    ./httperf[0x4032de]
    ======= Memory map: ========
    00400000-0040f000 r-xp 00000000 08:05 265276 /home/thiago/repo/performance-patterns/prototype/httperf
    0060e000-0060f000 r–p 0000e000 08:05 265276
    0060f000-00610000 rw-p 0000f000 08:05 265276
    00610000-0069c000 rw-p 00000000 00:00 0
    00f0e000-011e4000 rw-p 00000000 00:00 0 [heap]
    7fa5e6330000-7fa5e6346000 r-xp 00000000 08:06 3277773 /lib/x86_64-linux-gnu/libgcc_s.so.1
    7fa5e6346000-7fa5e6545000 —p 00016000 08:06 3277773 /lib/x86_64-linux-gnu/libgcc_s.so.1
    7fa5e6545000-7fa5e6546000 rw-p 00015000 08:06 3277773 /lib/x86_64-linux-gnu/libgcc_s.so.1
    7fa5e6546000-7fa5e6551000 r-xp 00000000 08:06 3279574 /lib/x86_64-linux-gnu/libnss_files-2.19.so
    7fa5e6551000-7fa5e6750000 —p 0000b000 08:06 3279574 /lib/x86_64-linux-gnu/libnss_files-2.19.so
    7fa5e6750000-7fa5e6751000 r–p 0000a000 08:06 3279574 /lib/x86_64-linux-gnu/libnss_files-2.19.so
    7fa5e6751000-7fa5e6752000 rw-p 0000b000 08:06 3279574 /lib/x86_64-linux-gnu/libnss_files-2.19.so
    7fa5e6752000-7fa5e690d000 r-xp 00000000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
    7fa5e690d000-7fa5e6b0d000 —p 001bb000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
    7fa5e6b0d000-7fa5e6b11000 r–p 001bb000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
    7fa5e6b11000-7fa5e6b13000 rw-p 001bf000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
    7fa5e6b13000-7fa5e6b18000 rw-p 00000000 00:00 0
    7fa5e6b18000-7fa5e6c1d000 r-xp 00000000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
    7fa5e6c1d000-7fa5e6e1c000 —p 00105000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
    7fa5e6e1c000-7fa5e6e1d000 r–p 00104000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
    7fa5e6e1d000-7fa5e6e1e000 rw-p 00105000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
    7fa5e6e1e000-7fa5e6e41000 r-xp 00000000 08:06 3279536 /lib/x86_64-linux-gnu/ld-2.19.so
    7fa5e701a000-7fa5e701d000 rw-p 00000000 00:00 0
    7fa5e703c000-7fa5e7040000 rw-p 00000000 00:00 0
    7fa5e7040000-7fa5e7041000 r–p 00022000 08:06 3279536 /lib/x86_64-linux-gnu/ld-2.19.so
    7fa5e7041000-7fa5e7042000 rw-p 00023000 08:06 3279536 /lib/x86_64-linux-gnu/ld-2.19.so
    7fa5e7042000-7fa5e7043000 rw-p 00000000 00:00 0
    7fffbb408000-7fffbb429000 rw-p 00000000 00:00 0 [stack]
    7fffbb525000-7fffbb527000 r-xp 00000000 00:00 0 [vdso]
    ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Leave a Reply