36

当我尝试使用具有高请求率的 httperf 执行负载测试时,我收到以下错误:

» httperf --client=0/1 --server=www.xxxxx.com --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=200 --rate=30
httperf --client=0/1 --server=staging.truecar.com --port=80 --uri=/ --rate=30 --send-buffer=4096 --recv-buffer=16384 --num-conns=200 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
**Segmentation fault: 11**

当“速率”> 15 时出现错误

版本:

httperf 0.9.0

OS X 10.7.1

4

3 回答 3

6

如警告所述,与 http 服务器的连接数超过了允许的打开文件描述符的最大数量。即使httperf将值限制为 FD_SETSIZE,您也可能会超出该限制。

您可以检查限制值ulimit -a

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 709
virtual memory          (kbytes, -v) unlimited

尝试增加限制ulimit -n <n>

$ ulimit -n 2048
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 2048
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 709
virtual memory          (kbytes, -v) unlimited

这是大型 Web 服务器等的常见做法,因为套接字本质上只是一个打开的文件描述符。

于 2011-12-16T23:33:37.370 回答
0

ksh并且bash正在使用ulimit,并且csh正在使用limit命令。

于 2011-12-25T22:48:55.110 回答
0

Try to use gdb and use something like:

$ gdb httperf --client=0/1 --server=staging.truecar.com \
--port=80 --uri=/ --rate=30 --send-buffer=4096 \
--recv-buffer=16384 --num-conns=200 --num-calls=1

This will invoke gdb and you should see a (gdb) prompt.

Then: run and enter.

If it'll crash, type bt (backtrace). Investigate and/or share on here.

于 2011-12-06T00:15:05.757 回答