httperf is a great benchmarking tool that I’ve been using to do some load testing. A colleague pointed me to it after struggling with Apache’s benchmark tool (ab). In my opinion, httperf is by far a superior tool as it provides many more knobs and switches. Most importantly, httperf’s output seems to me to be a little bit more usable.
One of the immediate problems I had with httperf was that whenever I had a –rate of higher than 2000, I started getting errors categorized as ‘fd-unavail’. A little research on the Internets and the issue (as its name would indicate) is that httperf is unable to open the necessary number of file descriptors to sustain the load. Since every open socket in Linux corresponds to an open file, the number of simultaneous open files allowed to a process or user becomes a bottleneck pretty quickly in getting httperf to perform at higher volumes.
Since my load test client was a Fedora box, the process to fix this is as follows:
1) edit /etc/security/limits.conf, adding <username> hard nofile 65535 . <username> in the user running httperf.
- # ulimit -n 65535
To verify the changes took place:
- # ulimit -aH (look for “open files”)
2) edit /usr/include/bits/typesizes.h and change #define __FD_SET_SIZE 1024 to #define __FD_SET_SIZE 65535.
3) download the httperf source
- # yum install yum-utils
- # yumdownloader –source httperf
4) install the source RPM (you may have to make a directory)
- # rpm -ihv httperf-0.9.0-2.fc8.src.rpm
5) compile the source RPM (and install dependency)
- # yum install rpm-build
- # yum install openssl-devel
- # cd /usr/src/redhat/SPECS
- # rpmbuild -bb httperf.specs
- # cd ../RPMS/x86_64/
6) remove the previous install and install the new build (which can handle more than 1024 fd)
- # yum remove httperf
- # rpm -ihv httperf.fc8.x86_64.rpm
This will leave you with an install of httperf that can open 65535 filehandles at a time. I did this on FC8, but I’m sure it’s easily adaptable to any RPM-based distro.
“good post”