Configure httperf to use more file descriptors
By default, httperf will only use 1024 file descriptors. This can cause a problem in sustaining a consistent load on an overloaded server. If httperf runs out of file descriptors then the results of that test run are meaningless.
- Configure system-wide limits:
# echo "65535" > /proc/sys/fs/file-max
- Make this permanent by adding this to /etc/sysctl.conf:
# Maximum number of open files permited fs.file-max = 65535
- Set the shell limit:
# ulimit -n 65535
- Make this permanent by adding this to /etc/security/limits.conf
root soft nofile 65535 root hard nofile 65535
- Alter your system header files to use the higher limit. In /usr/include/bits/typesizes.h:
/* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 65535 /* 1024 */
- Recompile httperf with the higher limits:
# make clean # make # make install
- Check the output of httperf with the -v option:
[root@slap2 ~]# httperf --server 10.0.0.39 --num-call 1 --num-conn 10 --rate 1000 --timeout 5 --wlog y,nul.txt -v httperf --verbose --timeout=5 --client=0/1 --server=10.0.0.39 --port=80 --uri=/ --rate=1000 --send-buffer=4096 --recv-buffer=16384 --num-conns=10 --num-calls=1 httperf: maximum number of open descriptors = 65535
See: http://www.hpl.hp.com/hosted/linux/mail-archives/httperf/2003-December/000128.html
