我的 Siege 版本是 4.0.2,使用的是 Ubuntu 16.04。Siege 安装在 中./.linuxbrew/Cellar/siege/4.0.2/etc/
。
我无法进行超过 255 个测试的加载,并且收到一条警告消息,如下所示:
$ siege -c1000 -t5m http://192.168.1.11:8080/
WARNING: The number of users is capped at 255. To increase this
limit, search your .siegerc file for 'limit' and change
its value. Make sure you read the instructions there...
================================================================
** SIEGE 4.0.2
** Preparing 255 concurrent users for battle.
The server is now under siege...
HTTP/1.1 403 1.50 secs: 819 bytes ==> GET /kiosk/start
HTTP/1.1 403 1.50 secs: 819 bytes ==> GET /kiosk/start
HTTP/1.1 403 1.51 secs: 819 bytes ==> GET /kiosk/start
HTTP/1.1 403 1.52 secs: 819 bytes ==> GET /kiosk/start
等等。我按下Ctrl+Z来终止命令。
然后我编辑了siegerc
文件(sudo vim siegerc
),如下所示:
verbose = true
color = on
quiet = false
show-logfile = true
logging = false
limit = 3000
protocol = HTTP/1.1
chunked = true
cache = false
concurrent = 3000
connection = close
即使重新启动机器后,我仍然收到相同的警告消息,并且仅加载了 255 个测试。
我该怎么做才能跑得更多?
答案1
基于https://linode.com/docs/tools-reference/tools/load-testing-with-siege/,看来如果你运行siege.config
,它会为你创建一个.siegerc
,然后你可以根据需要更新它。
答案2
添加-R
从文件读取配置的选项.siegerc
,类似于:
$ siege -R .siegerc ...
答案3
检查文件描述符限制:
ulimit -n
然后将其设置为更高的数字:
ulimit -n 4096