怎么用php实现 网站在访问量大的情况下 限制网站访问的并发数 http://www.linuxaid.com.cn/articles/8/6/864844289.shtml 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在apache下限制每个虚拟主机的并发数!!!! http://www.chinaunix.net 作者:iloveyoufreebsd 发表于:2003-06-23 15:23:24 下载模块: http://www.nowhere-land.org/programs/mod_vhost_limit/mod_vhost_limit-0.4.tar.gz 官方网址: http://www.nowhere-land.org/programs/mod_vhost_limit/ 安装: apxs -c mod_vhost_limit.c -o /path/to/libexec/mod_vhost_limit.so 在 httpd.conf 加入: LoadModule vhost_limit_module libexec/mod_vhost_limit.so AddModule mod_vhost_limit.c 配置: 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> 其中: server1 被限制为 100 个并发线程数。 server2 被限制为 30 个并发线程数。 server3 没有被限制。 注:需 mod_status 的 ExtendedStatus On 支持!! 如超出限制的并发数在客户端就会出现503错误: 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 在 error_log 中将会有类似以下的错误提示: [Mon Jun 23 15:22:24 2003] [error] client access to server1 deferred, MaxVhostClients 100 exceeded 希望对大家有用!! 查到了,通过apache可以实现.....MaxKeepAliveRequests: apache上发布的应用为什么不能访问 如何统计一周的信息数量? Smarty 中的函数? PHP向MSSQL数据库写入记录的时候遇到money字段类型问题,请看 留言板问题求助 有人做过用.hta与php相结合的应用程序吗 挑战:字符串变换~ 如何将一组数据写入html文件 100分救命,很急 表中的分页问题 ,分不多了,只能给这些了!!!!! Matrix==array(array()),呵呵,是吧? 急问:怎样取出下面这个字符串中的两个文件名?
在apache下限制每个虚拟主机的并发数!!!! http://www.chinaunix.net 作者:iloveyoufreebsd 发表于:2003-06-23 15:23:24 下载模块: http://www.nowhere-land.org/programs/mod_vhost_limit/mod_vhost_limit-0.4.tar.gz 官方网址: http://www.nowhere-land.org/programs/mod_vhost_limit/ 安装: apxs -c mod_vhost_limit.c -o /path/to/libexec/mod_vhost_limit.so 在 httpd.conf 加入: LoadModule vhost_limit_module libexec/mod_vhost_limit.so
AddModule mod_vhost_limit.c 配置: 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> 其中: server1 被限制为 100 个并发线程数。 server2 被限制为 30 个并发线程数。 server3 没有被限制。 注:需 mod_status 的 ExtendedStatus On 支持!! 如超出限制的并发数在客户端就会出现503错误: 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 在 error_log 中将会有类似以下的错误提示:
[Mon Jun 23 15:22:24 2003] [error] client access to server1 deferred, MaxVhostClients 100 exceeded 希望对大家有用!!
MaxKeepAliveRequests: