Home > Article > Backend Development > Limit the number of concurrencies per virtual host under Apache! ! ! ! _PHP Tutorial
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
Official website: 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 in httpd.conf:
LoadModule vhost_limit_module libexec /mod_vhost_limit.so
AddModule mod_vhost_limit.c
Configuration:
MaxClients 150
ExtendedStatus On
NameVirtualHost *
ServerName server1
DocumentRoot /some/where/1
MaxVhostClients 100
ServerName server2
DocumentRoot /some/where/2
MaxVhostClients 30
ServerName server3
DocumentRoot /some/where/3
Where: server1 is limited to 100 concurrent threads. server2 is limited to 30 concurrent threads. server3 is not restricted.
Note: ExtendedStatus On support of mod_status is required! !
If the number of concurrency exceeds the limit, a 503 error will appear 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
There will be an error message similar to the following in the error_log:
[Mon Jun 23 15:22:24 2003] [error] client access to server1 deferred, MaxVhostClients 100 exceeded
Hope it’s useful to everyone! ! (Source: http://www.allabc.com)