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 ApacheBench, 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 www.nginx.cn (be patient) Completed 100 requestsCompleted 200 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsCompleted 1000 requestsFinished 1000 requestsServer Software: nginx/1.2.3Server Hostname: www. nginx. cnServer Port: 80 Document Path:/AB .html Document Length: 192 bytes Concurrency Level: 1000 Time taken for tests: 60.444 secondsComplete requests: 1000 Failed requests: 139 (Connec T: 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, average SS 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 Waiting: 57 60117 5337 12990.0 341 Total: 59870 386 5611 13083.7 Percentage of the requests served within a certain time (MS) 50% 57266% 60675% 63580% 67290% 3009795% 4200498% 4725099% 49250100% 60443 (longest request) You can use the same command for PHP files 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 output results 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. Htop command results detailed source reference: http://www.nginx.cn/110.html seems I need a good optimization, or just replace the machine. Reference http://go2linux.garron.me/linux/2010/04/how-benchmark-stress-your-apache-nginx-or-iis-server-718 detailed source reference: http://www.nginx.cn/110.html