工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.wdlinux.cn 注册 | 登陆
浏览模式: 标准 | 列表2012年03月9日的文章

Squid 限制用户并发连接数

client_db  on
acl client_10 src 192.168.0.0/32
acl maxconnect maxconn 10
http_access deny client_10 maxconnect
 
-------------------------
查了一下,该错误是因为打开的文件数超过了linux的限制造成的。因此对系统和squid配置文件进行了修改:
1)对系统进行修改,取消对打开文件数的限制。
  ulimit -HSn 65535
    为了防止重启后失效,在/etc/profile文件中增加该命令。
    查看是否生效,使用命令:ulimit -n
2)修改squid配置文件,增加并发数
    打开配置文件:gedit ../squid/etc/squid.conf
    a) 增加如下内容:acl OverConnLimit maxconn 2000
    b) 将以前的设置"http_access deny all" 修改为 "http_access allow all"