起由:Your cache is running out of filedescriptors
41的squid代理服务器出现以上警告,导致浏览网页速度超慢。
优化步骤:
1.查看
# ulimit -n
1024
需要增大文件描述符,需要调整Ubuntu内核参数,调整方法如下:
2.squid重运行configure,重新编译安装
3.安装参数如下(./configure的配置项)
4.重新启动squid后,检查参数配置是否生效。squidclient mgr:info
**************************************************
在文件/etc/security/limits.conf
中添加user hard nofile 65533
在/etc/pam.d/common-session
添加: session required pam_limits.so
Some versions of squid have a compile-time limitation of 1024 maximum that cannot be increased by using ulimit at run-time.
A new configuruation option max_filedesc has been added to the following versions of Squid:
Red Hat Enterprise Linux 3: squid-2.5.STABLE3-6.3E.18
Red Hat Enterprise Linux 4: squid-2.5.STABLE14-1.4E
(This option is included in Squid for Red Hat Enterprise Linux 5 by default.)
Squid needs to be updated to the specified versions or above in order to use the new configuration option.
For example, to increase the maximum file descriptors to 4096, please do the following:
-
In /etc/security/limits.conf , add this line:
* - nofile 4096
-
Save the file, logout and re-login to a shell. Use "ulimit" to check:
# ulimit -a
open files (-n) 4096
-
Modify the /etc/squid/squid.conf and add this line:
max_filedesc 4096
(Notice: the value of max_filedesc should be the same as the value of nofile in /etc/security/limits.conf)
-
Restart the squid service:
# service squid restart
Use "squidclient" to check:
# squidclient mgr:info
File descriptor usage for squid:
Maximum number of file descriptors: 4096
*****************************************************
./configure的配置项
./configure --prefix=/usr/local/squid --with-large-files --enable-useragent-log --enable-referer-log --enable-linux-netfilter --enable-x-accelerator-vary --disable-internal-dns --disable-mempools --with-maxfd=65535
3.0版本去掉了以下选项:
--enable-dlmalloc 不再需要
--enable-epoll 系统会自己选择最优的I/O Loop Method
--enable-truncate 不再需要
--enable-follow-x-forwarded-for 没有此项配置了
增加了以下选项:
--disable-mempools 相当于2.7配置文件里面的memory_pools off,适合内存使用较大的情况,系统会调用free()来清除没用到的缓存内存
--with-maxfd=65535 相当于ulimit -n 65535,2.7配置文件里面的max_filedescriptors 65535
******************************************************************************
3.8 重运行configure
有时候你可能发现有必要重新运行./configure。例如,假如你调整了内核参数,你必须再次运行./configure以使它能发现新设置。当你阅读本书时,你也发现你必须使用./configure选项来激活所需的功能。
以相同的选项重运行./configure,使用如下命令:
%config.status --recheck
另一个技术是`touch config.status`文件,它更新了该文件的时间戳。这导致make在编译源代码之前,重新运行./configure脚本:
% touch config.status
% make
分享到:
相关推荐
Squid 代理服务器.ppt Squid 代理服务器.ppt
Squid代理服务器原理
网络管理与维护 实验报告(九):squid代理服务器.doc
构建Linux下的Squid代理服务器.pdf
基于linux的Squid代理服务器的架设分析.doc
本文介绍Linux下非常著名、常用的Squid代理服务器的使用,并着重讲述如何使用其提供的访问控制策略,来保证代理服务器的合法使用。
对于Web用户来说,Squid是一个高性能的代理缓存服务器,可以加快内部网浏览Internet的速度,提高客户机的访问命中率。Squid不仅支持HTTP协议,还支持FTP、gopher、SSL和WAIS等协议。和一般的代理缓存软件不同,Squid...
一、squid代理服务器概述; 二、squid代理服务器模式; 三、案例:搭建squid代理传统代理服务器; 搭建squid代理传统代理服务器
基于Linux网络系统的Squid代理服务器的构建.pdf
linux下的squid代理服务器配置详情。。。
利用Linux和Squid建立缓存代理服务器的优化方案研究.pdf
docker-squid, Dockerfile为Squid代理服务器创建 Docker 容器映像 sameersbn/squid: 3 。3 。8-23简介 。问题正在开始运行。安装工具快速入门命令行参数持久性解决方案配置文件使用情况日志记录维护工具升级插件...
suqid 缓存服务器整理的相关内容,可以参考的。适合于centos7系统的
Squid有广泛的用途,从作为网页服务器的前置cache服务器缓存相关请求来提高Web服务器的速度,到为一组人共享网络资源而缓存万维网,域名系统和其他网络搜索,到通过过滤流量帮助网络安全,到局域网通过代理上网。...
Squid代理服务器的搭建[归纳].pdf
linux搭建squid代理服务器
Squid有广泛的用途,从作为网页服务器的前置cache服务器缓存相关请求来提高Web服务器的速度,到为一组人共享网络资源而缓存万维网,域名系统和其他网络搜索,到通过过滤流量帮助网络安全,到局域网通过代理上网。...
Squid Windows版架设二级代理服务器
Squid代理服务器搭建培训.pptx
Squid是一个高性能的代理缓冲服务器,也许你已经用过Windows平台下的WinGate,MS Proxy Server等功能类似的产品。Squid是一个应用级代理,在保证客户端主机和服务器主机网络连通后,需要客户端软件做相应的设置后...