Use AB for nginx stress testing

Source: Internet
Author: User
Nginx is famous for its high concurrency and memory saving. I believe most people who install nginx want to know their nginx performance. I would like to share with you the stress testing methods and results of using the AB tool. AB is a performance testing tool for apache and can only install the AB tool. Ubuntu uses the following command... nginx is famous for its high concurrency and memory saving. I believe most people who install nginx want to know their nginx performance. I would like to share with you the stress testing methods and results of using the AB tool. AB is a performance testing tool for apache and can only install the AB tool. Ubuntu requires a simple html, a php, and an image file before testing with the following command apt-get install apache2-utils. Test them separately. We put the three files in the default html Directory of the nginx installation directory. after preparation, we can test the AB-kc 1000-n 1000. http://localhost/ab.html This command uses 1000 concurrent connections for 1000 times. Results: root @ SNDA-172-17-12-117:/usr/local/nginx # AB-kc 1000-n 1000 http://www.nginx.c N/AB .html This is apacheiss, Version 2.3 <$ Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed To The Apache Software Foundation, http://www.apache.org/ Benchmarking merge (be patient) Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 bytes 600 bytes 700 bytes 800 bytes 900 requestsServer Software: nginx/1.2.3Server Hostname: www. nginx. cnServer Port: 80 Document Path:/AB .html Document Length: 192 bytes Es Concurrency Level: 1000 Time taken for tests: 60.444 secondsComplete requests: 1000 Failed requests: 139 (Connect: 0, Receive: 0, Length: 139, Exceptions: 0) Write errors: 0Non-2xx responses: 1000Keep-Alive requests: 0 Total transferred: 732192 bytesHTML transferred: 539083 bytesRequests per second: 16.54 [#/sec] (mean) Time per request: 60443.585 [MS] (mean) time per request: 60.444 [MS] (mean, acros S all concurrent requests) Transfer rate: 11.83 [Kbytes/sec] specified Ed Connection Times (MS) min mean [+/-sd] median maxConnect: 55 237 89.6 261 328 Processing: 58 5375 13092.8 341 60117 Waiting: 57 5337 12990.0 341 59870 Total: 386 5611 13083.7 572 60443 Percentage of the requests served within a certain time (MS) 50% 57266% 60675% 63580% 67290% 3009795% 4200498% 4725099% 49250100% (longest request You can use the same command for PHP and image files, and I will not post the results. AB-kc 500-n 5000 http://localhost/ab.php AB-kc 500-n 5000 http://localhost/ab.gif The output result can be understood literally. Here two more important indicators are described as follows: Requests per second: 16.54 [#/sec] (mean) Time per request: 60443.585 [MS] (mean) requests per second indicates that the server currently tested can process 16.54 static html Requests per second. Time per request indicates the Time it takes for nginx to receive a user request and return a response page. You can adjust the-c and-n values to test the server performance. you can use the htop command to intuitively view the server load. My machine is an ultra-micro host of Shanda cloud, and the cpu load is 1.7% at ordinary times. The htop command results in a pressurization load of 100%, and the load has basically come up. For detailed htop command results, refer: http://www.nginx.c N/110.html it seems that I need to optimize it, or just change the machine. Reference http://go2linux.garron.me/linux/2010/04/how-benchmark-stress-your-apache-nginx-or-iis-server-718 For details, refer: http://www.nginx.c N/110.html
Related Article

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.