Stress-Test your application in Linux

Source: Internet
Author: User

Stress-Test your application in Linux

Author: site
Email: [Email protected]
qq:511363759

I. Webbench

1. Install webbench-in Ubuntu to support Get,head and other requests, but does not support post requests
wget http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gztar zxvf webbench-1.5.tar.gzcd webbench-1.5make && make install
2. Test Demo
webbench -t 5 -c 2 http://google.com/   >2个并发用户共同请求5秒
3. Test results Analysis
  1. Benchmarking: GET http://google.com/ #GET方法请求谷歌
  2. 2 clients, running 5 sec. #2个用户,运行5秒
  3. Speed=4296 pages/min, 38664 bytes/sec. #4296个页面每秒,38664 bytes每秒
  4. Requests: 358 susceed, 0 failed. #358次请求成功,0次失败
Two. Ab1. Install ab-in Ubuntu support post, get, head and other methods
sudo apt-get install apache2-utils
2. Test Demo
ab -n 500 -c 2  http://www.google.com/   >2个并发用户共同请求个数500个。
3. Test results Analysis
  1. Server Software: gws #服务器信息
  2. Server Hostname: www.google.com #测试地址
  3. Server Port: 80 #测试端口
  4. Document Path: / #测试文档路径
  5. Document Length: 390 bytes #测试文档大小
  6. Concurrency Level: 2 #并发数量
  7. Time taken for tests: 6.752 seconds #测试消耗时间
  8. Complete requests: 500 #完成的请求数
  9. Failed requests: 0 #失败的请求数
  10. Non-2xx responses: 500 #HTTP响应数据的头信息中含有2XX以外的状态码的请求数
  11. Total transferred: 566000 bytes #总传输数据大小
  12. HTML transferred: 195000 bytes #总传输html数据大小
  13. Requests per second: 74.05 [#/sec] (mean) #吞吐量,每秒处理平均请求数
  14. time per request: Span class= "lit" >27.007 [ms (mean #每个请求平均等待时间
  15. Time per request: 13.504 [ms] (mean, across all concurrent requests) #服务器每个请求平均处理时间
  16. Transfer rate: 81.86 [Kbytes/sec] received #平均每秒流量数
  17. Connection Times (ms) #下面为时间花费的分布(连接、处理、等待、总数)
  18. min mean[+/-sd] median max
  19. Connect: 1 1 0.2 1 2
  20. Processing: 22 26 7.6 25 150
  21. Waiting: 22 26 7.6 25 150
  22. Total: 23 27 7.6 26 151
  23. ###下面为每个请求花费时间的分布
  24. Percentage of the requests served within a certain time (ms)
  25. 50% 26 #50%在26毫秒之内
  26. 66% 27 #66%在27毫秒之内
  27. 75% 27
  28. 80% 27
  29. 90% 28 #主要看这个参数,90%在28毫秒之内
  30. 95% 29
  31. 98% 36
  32. 99% 52
  33. 100% 151 (longest request)

To add data to the request header, as follows:

    1. ab -H "Cookie: key=value;key2=value2" ...
4. Use AB for post requests
    1. ab -c 1 -n 100 -T ‘application/json‘ -p data.json http://www.google.com/

The test results are not posted, and one more obvious result:

    1. Total body sent: 15900 #body总的发送量

Stress-Test your application in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.