OS X 10.7.1上的httperf分段错误错误

时间:2011-09-08 15:58:30

标签: testing load httperf

当我尝试使用具有高请求率的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**

当“费率”> 1时,错误会上升。 15

版本:

httperf 0.9.0

OS X 10.7.1

3 个答案:

答案 0 :(得分: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服务器之类的常见做法,因为套接字本质上只是一个开放的文件描述符。

答案 1 :(得分:0)

尝试使用gdb并使用类似:

的内容
$ 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

这将调用gdb,您应该看到(gdb)提示符。

然后:run并输入。

如果它崩溃,请输入bt(回溯)。在这里调查和/或分享。

答案 2 :(得分:0)

kshbash正在使用 ulimit csh正在使用 limit 命令。