显示标签为“squid”的博文。显示所有博文
显示标签为“squid”的博文。显示所有博文

星期五, 四月 11, 2008

clientAccessCheck: proxy request denied in accel_only mode

Squid Cache: Version 2.5

Looks like the client is trying to use you as a proxy, either directly or indirectly via another proxy..
However, HTTP/1.1 requires HTTP servers to accept such request. Turn "httpd_accel_with_proxy on".
You should also make sure your access control rules is set correcly to only allow access to your servers if you haven't already.. Not the cause to your problem, but may be a cause to other problems later if not done..

星期四, 十一月 01, 2007

squid filedescriptors 问题处理

最近,squid系统中的一台机器的硬盘坏了一块,所以对将squid系统切到了被分际上运行,刚开始很好,不久之后备份机的所有网络端口决绝响应!
现象描述如下,网络通,可ping到备份机,服务端口通过Telnet可以脸上,但是不响应任何输入!在运行日志中发现了如下信息!
WARNING! Your cache is running out of filedescriptors

由于主机与备份机软件系统相同,硬件配置基本相同,所以并未对这个WARNING多做关注,重新启动备份机后继续运行,不久之后又出现了上面的日志!

Google之后,初步判断这个状态与系统的工作不正常是有关联的,文件描述符被用尽了,所以不能在打开文件了(Socket与fd)是俩回事,所以可能Socket连上,但是无法响应!

处理这个问题的办法也很简单,在保证程序正确的情况下,可以通过增大系统支持的文件描述符个数来解决!

1修改系统的最大的file descriptors数

# ulimit -SHn 2048
# vi /usr/include/bits/types.h
将#define __FD_SETSIZE 1024改成#define __FD_SETSIZE 2048
然后重新编译你的squid
然后把ulimit -SHn 2048这行放到你的squid的启动脚本的最前面

vi /usr/include/bits/type.h (to change __FD_SETSIZE)

编译完后记得把types.h里的2048改回去