Nginx stress testing and protection against malicious stress testing

Source: Internet
Author: User

Nginx stress testing and protection against malicious stress testing

Nginx Pressure Test method: # AB command # install AB # Centos system yum install apr-util # Ubuntu system sudo apt-get install apache2-utils # parameters of the AB command-n // number of requests executed in the test session. The default value is 1-c // The number of requests generated at a time. The default value is 1-T // The maximum number of seconds for testing. The default value is 1000-P // the Content-type header information used by the data file-T // POST required # instance AB-c 5000-n http://www.baidu.com/the total number of concurrent requests sent each time is. ---------------------------------------------------------------------------- # How to Set nginx to prevent stress testing: # limit the maximum concurrency of the same IP address to 10vim/etc/nginx. add the first line of the confhttp {} field: limit_conn_zone $ binary_remote_addr zone = one: 10 m; vim/etc/nginx/conf. d/defaultserver {} field added: limit_conn one 10; # restart nginxservice nginx restart # If this error message appears, it indicates nginx. limit_conn_zone $ binary_remote_addr zone = one: 10 m; # is not added to the correct region, and is added to the first line of the http field. The size 10485760 of shared memory zone "one" conflicts with already declared size 0 in/etc/nginx. conf: 33

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.