Limit the concurrency of each virtual host under Apache !!!!

Source: Internet
Author: User


From http://www.allabc.com
Forum: http://seecee.dev-c.nl/forumdisplay.php? FID = 4

Download module:

Http://www.nowhere-land.org/prog... st_limit-0.4.tar.gz

Http://www.nowhere-land.org/programs/mod_vhost_limit/

Installation:

Apxs-C mod_vhost_limit.c-O/path/to/libexec/mod_vhost_limit.so

Add the following content to httpd. conf:

Loadmodule vhost_limit_module libexec/mod_vhost_limit.so
Addmodule mod_vhost_limit.c

Configuration:

Maxclients 150
Extendedstatus on

Namevirtualhost *

<Virtualhost *>
Servername server1
DocumentRoot/Some/where/1
Maxvhostclients 100
</Virtualhost>

<Virtualhost *>
Servername server2
DocumentRoot/Some/where/2
Maxvhostclients 30
</Virtualhost>

<Virtualhost *>
Servername server3
DocumentRoot/Some/where/3
</Virtualhost>

Specifically, server1 is limited to 100 concurrent threads. Server2 is limited to 30 concurrent threads. Server3 is not restricted.

Note: extendedstatus on of mod_status is required !!

If the maximum number of concurrent threads is exceeded, the error 503 will occur on the client:

Service temporarily unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
--------------------------------------------------------------------------------

Apache/1.3.27 server at server1 port 80

The error message similar to the following will be displayed in error_log:
[Mon Jun 23 15:22:24 2003] [Error] client access to server1 deferred, maxvhostclients 100 exceeded

Hope to be useful to everyone !! (Source: http://www.allabc.com)

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.