当我尝试使用高请求率的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**当"rate“>15时,错误增加
版本:
httperf 0.9.0
OS X 10.7.1
发布于 2011-12-17 07:33:37
正如警告所述,到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-06 08:15:06
尝试使用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 (回溯)。在这里调查和/或分享。
发布于 2011-12-26 06:48:55
ksh和bash使用的是ulimit,csh使用的是limit命令。
https://stackoverflow.com/questions/7351035
复制相似问题