Use Apache to control concurrent website requests to prevent website Paralysis

Source: Internet
Author: User

Due to project requirements, it may put pressure on the concurrent requests of Web Services, so I thought of the method of Request control at the Apache layer.

Because there is already a mod_limitipconn that can be used for concurrent Connection Control, but because keepalive is used, you also need to control the total number of concurrent requests and after the concurrent request is exceeded, the business needs to redirect requests to a page. Therefore, the service needs to be modified based on mod_limitipconn to meet the business needs.

The configuration example is as follows:

Extendedstatus on
Loadmodule limitipconn_module modules/mod_limitipconn.so
<Ifmodule mod_limitipconn.c>
Maxconnperip 1000
<Location/imlogingw>
Maxconnperip 300
# Noiplimit image /*
Maxreqconcurrent 60
Exceedrequrl http: // 10.2.224.63/
</Location>
</Ifmodule>

 

Control the concurrency of the Directory http: // 10.2.224.63/imlogingw. When the threshold value (60) is exceeded, redirect the request to the http: // 10.2.224.63/page.

 

Correct use after stress testing

 

The original mod_limitipconn can be

Http://dominia.org/djao/limitipconn.html download, improved mod_limitipconn can be from

Http://limitipconnreq.googlecode.com/files/mod_limitipconn-0.23-jaymo.tar.gz

 

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.