Nginx stress test

Source: Internet
Author: User

Nginx can be used as an HTTP server and reverse proxy server. The reverse proxy server depends on the performance of the backend server. This time, it only tests the performance of the HTTP server. As a server, nginx is dependent on the network performance, especially the PPS forwarding capability. Therefore, network-enhanced instances must be the first choice.

With 10G network bandwidth, we recommend that you use the following ECs instance type families. sn1ne (nginx has low memory requirements and does not require ECs instances of the specification family. sn2ne); in 25G network bandwidth, the recommended instance type family is C5.

Test Verification Test Method
    • Operating System: centos 7.3 (irqbalance is enabled by default)
    • Testing Software: nginx 1.12.1
    • Stress Testing Tool: apache2132.3
Test Object
    • ECS. sn1ne. 4 xlarge 16C/32 GB
    • ECS. sn1ne. 8 xlarge 32C/64 GB
Test Architecture

Pressure Test command

32 concurrent command: AB-N 100000000-C 10-K http: // $ {server_ip }/

Parameter Adjustment

System Parameter Adjustment

Open multiple queues.
Enable RPS.

After testing, it is found that when the 16-core feature is not enabled, all CPUs can be fully occupied and the network reaches the limit. However, when testing the 32-core feature, the RPS needs to be enabled.

Modify the number of opened files.

Nginx parameter adjustment.

Open a multi-process. Nginx is a single work process by default.

You can configure the following in the nginx. conf file:

Worker_processes 32;

Worker_cpu_affinity auto;

Increase the number of connections: Configure worker_connections 102400.

Test conclusion

    • Sn1ne. 4 xlarge has a PPS of up to 150 W, and the pressure test QPS reaches 140 W. At this time, all CPU usage is close to 100%. (The QPS is measured by Tsar .)

    • The maximum PPS of sn2ne. 8 xlarge is 250 W, and the pressure test QPS reaches 210 w. At this time, all CPU usage is close to 100%.

Nginx stress test

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.