Loading... <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">yum install gcc</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">wget http://download.joedog.org/siege/siege-4.0.2.tar.gz</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">tar -zxf siege-4.0.2.tar.gz</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">cd siege-4.0.2.tar.gz</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">./configure;make</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">make install</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">以上就是一键安装命令一键就可以安装完毕,我们就已经更新到官网最新版本~</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">使用方法</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">siege -c 200 -r 20 http://baidu.com</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">#-c 200 并发200个用户 -r 20 重复循环20</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">以上是基本命令,假如说你还想使你的攻击力加强请请看下面的参数详解</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">参数详解</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-C,或–config 在屏幕上打印显示出当前的配置,配置是包括在他的配置文件$HOME/.siegerc中,可以编辑里面的参数,这样每次siege 都会按照它运行.</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-v 运行时能看到详细的运行信息</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-c n,或–concurrent=n 模拟有n个用户在同时访问,n不要设得太大,因为越大,siege 消耗本地机器的资源越多</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-i,–internet 随机访问urls.txt中的url列表项,以此模拟真实的访问情况(随机性),当urls.txt存在是有效</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-d n,–delay=n hit每个url之间的延迟,在0-n之间</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-r n,–reps=n 重复运行测试n次,不能与 -t同时存在</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-t n,–time=n 持续运行siege ‘n’秒(如10S),分钟(10M),小时(10H)</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-l 运行结束,将统计数据保存到日志文件中siege .log,一般位于/usr/local/var/siege .log中,也可在.siegerc中自定义</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-R SIEGERC,–rc=SIEGERC 指定用特定的siege 配置文件来运行,默认的为$HOME/.siegerc</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-f FILE, –file=FILE 指定用特定的urls文件运行siege ,默认为urls.txt,位于siege 安装目录下的etc/urls.txt</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">-u URL,–url=URL 测试指定的一个URL,对它进行”siege “,此选项会忽略有关urls文件的设定</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">url.txt文件:是很多行待测试URL的列表以换行符断开,格式为:</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">[protocol://]host.domain.com[:port][path/to/file]</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">用法举例:</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">siege -c 300 -r 100 -f url.txt</span><br style="word-wrap:break-word;color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;" /> <p> <span style="color:#444444;font-family:Tahoma, "font-size:14px;white-space:normal;background-color:#FFFFFF;">说明:-c是并发量,-r是重复次数。url.txt就是一个文本文件,每行都是一个url,它会从里面随机访问的。</span> </p> <p> <span style="color:#444444;">转 <a href="http://www.hostloc.com/thread-351778-1-2.html" target="_blank">http://www.hostloc.com/thread-351778-1-2.html</a></span> </p> 最后修改:1970 年 01 月 01 日 © 允许规范转载 打赏 赞赏作者 赞 如果觉得我的文章对你有用,请随意赞赏