自己在cmd中写了半天的路径也没有写对。最后网上的一个哥们告诉我说没有共同语言了。。。毛线啊 差距确实很大!大能猫死panda早晚干掉你,叫你丫整天嘲讽我!
比如我的ab.exe在D盘的wamp文件夹下apache文件夹下bin文件夹下。那么在cmd中可以这么写:"D:\wamp\apache\bin\ab.exe" 还有一种更加简单的方式。而且因为这种方式我被能猫又一次嘲讽!大家知道什么事资源管理器吗? 不懂的去百度下!说白了资源管理器就是我的电脑!没错你没有听错就是我的电脑!只要998!他是各种嘲讽我啊~谁叫咱们菜呢,接着按住shift+右击你的ab.exe 。点击复制路径之后再在cmd中粘贴就行了,你运行之后就是传说的ab.exe了。。。。。毛线啊。各种被嘲讽,而且昨天我把公司的数据库字段改了,我问他我 要怎么办。给我三字:细软跑!日的。
进入ab.exe之后在网上搜教程吧成吨的多有一点要注意。有得帖子上直接写的是ab -n 1000 -c1000 http:///这样写在我的电脑下是不能运行的。要在前面加上ab的路径就可以了。
由于我这里网速较慢所以测试的时候等了会。问大猫,他告诉我这是测试本地压力的。。。测试网上的全被网速所影响毫无意义。。所以你懂的!又一次被嘲讽!
苦逼的我啊。。。
好吧 我刚才给他显摆了下成果。然后又被嘲讽了。。我写的太复杂了有一种更简单的方法。在bin目录下按住shift+空白处右击。。点击在此处打开命令窗口。
然后直接写ab xxx就可以了 。。。。。。
wamp\bin\apache\Apache2.2.11\ab.exe
用于简单的单元测试,用法:
ab -n 10 -c 10 http:///
可以得到很多结果:
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http:// (be patient).....done
Server Software: GWS/2.1//谷歌自己开发的用来替代apache。
Server Hostname:
Server Port: 80
Document Path: /
Document Length: 230 bytes//文件长度
Concurrency Level: 10
Time taken for tests: 3.234651 seconds
Complete requests: 10
Failed requests: 0
<Connect:0;Length:150,Exceptions:0>
Write errors: 0
Non-2xx responses: 10
Keep-Alive requests: 10
Total transferred: 6020 bytes
HTML transferred: 2300 bytes
Requests per second: 3.09 [#/sec] (mean)
Time per request: 3234.651 [ms] (mean)
Time per request: 323.465 [ms] (mean, across all concurrent requests)
Transfer rate: 1.55 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 20 318 926.1 30 2954
Processing: 40 2160 1462.0 3034 3154
Waiting: 40 2160 1462.0 3034 3154
Total: 60 2479 1276.4 3064 3184
Percentage of the requests served within a certain time (ms)
50% 3064
66% 3094
75% 3124
80% 3154
90% 3184
95% 3184
98% 3184
99% 3184
100% 3184 (longest request)
