squid!Your cache is running out of file

[20140221]squid WARNING! Your cache is running out of filedescriptors.txt

--这一阵子,我们的代理出现一些问题.
--我检查发现如下:
2014/02/21 14:53:10| client_side.cc(2993) okToAccept: WARNING! Your cache is running out of filedescriptors

--看来文件描述设置太小,前面的管理人员设置有问题.我google,找到一些链接:
http://www.cyberciti.biz/faq/squid-proxy-server-running-out-filedescriptors/

# squidclient -p 31888  mgr:info | grep 'file descri'
        Maximum number of file descriptors:   1024
        Available number of file descriptors:   12
        Reserved number of file descriptors:   100

--注意这样写不行.squidclient mgr:info -p 31888  ,Available number of file descriptors已经很小.

--增加file descriptors的方法,修改/etc/security/limits.conf:

Squid increase the maximum file descriptors

First, update /etc/security/limits.conf file:
# vi /etc/security/limits.conf
Append following line to increase current limit from 1024 to 4096:
* - nofile 4096
Save and close the file. You must re-login to check new limits:
# ulimit -a | grep 'open files'
Sample output:

open files                      (-n) 4096

Next you need to set the maximum number of open file descriptors by modifying squid proxy server configuration as per
your Linux distribution.

Set max_filedesc under RHEL / Red Hat / CentOS / Fedora Linux

Stop the Squid as changes of this value isn't respected by reconfigure command. This value should be changed only if
there isn't any active squid process.

# service squid stop
Open /etc/squid/squid.conf file
# vi /etc/squid/squid.conf
Append / add / modify max_filedesc directive:
max_filedesc 4096
Save and close the file. Start the squid proxy server:
# service squid start
Now again run squidclient command or check log files for messages:
# squidclient mgr:info
Set max_filedesc under Ubuntu / Debian Linux

First, stop squid proxy server, enter:
# /etc/init.d/squid stop
OR
$ sudo /etc/init.d/squid stop

Open /etc/default/squid to set max. number of filedescriptors to use. You can increase this on a busy
cache to a maximum of (currently) 4096 filedescriptors. Default is 1024.

$ sudo vi /etc/default/squid
OR
# vi /etc/default/squid
Now set SQUID_MAXFD:
SQUID_MAXFD=4096
Save and close the file. Start the squid proxy server:
$ sudo /etc/init.d/squid start
Verify that it is working with new limits:
# squidclient mgr:info | grep 'file descri'

--我选择第1种方式修改.增加到65536.要重启squid就可以了.

# squidclient -p 31888  mgr:info | grep -A7 'File descriptor usage for squid'
File descriptor usage for squid:
        Maximum number of file descriptors:   65536
        Largest file desc currently in use:   2388
        Number of file desc currently in use: 2248
        Files queued for open:                   0
        Available number of file descriptors: 63288
        Reserved number of file descriptors:   100
        Store Disk files open:                   4

--可以发现现Number of file desc currently in use增加到2248.

时间: 2024-11-06 11:32:42

squid!Your cache is running out of file的相关文章

centOS下msyql启动错误-Multiple MySQL running but PID file could not be found

今天在centOS下装MySQL时出现了一个错误: 解决方案就是如图所示kill 4734 kill 4839 最后再执行[root@localhost src]# service mysql start就可以了

squid源码安装的服务启动脚本

#!/bin/bash # squid This shell script takes care of starting and stopping # Squid Internet Object Cache # # chkconfig: - 90 25 # description: Squid - Internet Object Cache. Internet object caching is \ # a way to store requested Internet objects (i.e

ceph cluster sample configure file in src

ceph集群的配置文件模板如下 :  [root@localhost src]# cat sample.ceph.conf  ## # Sample ceph ceph.conf file. ## # This file defines cluster membership, the various locations # that Ceph stores data, and any other runtime options. # If a 'host' is defined for a da

buffer & cache

In Linux, what is the difference between "buffers" and "cache" reported by the free command? This is an old question that I've seen from time to time. My understanding of it is rather limited (having read about the differences a long t

【转】File Mapping技术

原文转载自http://dustin.iteye.com/blog/46777   File Mapping析疑     最初接触File Mapping是为了能够方便地处理一个几百兆的大文件,当时查了些资料大概了解了一下就匆匆动手了,因为知其然而不知其所以然,在使用过程中遇到了不少问题,今天在这里就是想把这些历史遗留问题解决掉.     问题一.Mapping有"映射"之意,那么在该语境中形成映射关系的双方是谁,也就是从哪里映射到哪里呢?     要回答这个问题,我们必须要对虚拟内存

File Mapping析疑

最初接触File Mapping是为了能够方便地处理一个几百兆的大文件,当时查了些资料大概了解了一下就匆匆动手了,因为知其然而不知其所以然,在使用过程中遇到了不少问题,今天在这里就是想把这些历史遗留问题解决掉.     问题一.Mapping有"映射"之意,那么在该语境中形成映射关系的双方是谁,也就是从哪里映射到哪里呢?     要回答这个问题,我们必须要对虚拟内存有所了解.现在操作系统中,大多都使用虚拟内存技术来对内存进行管理.通过虚拟内存,操作系统给予了每个进程一个统一的地址空间.

Linux Squid代理的普通代理

一.安装Squid和配置 1.安装Squid yum-yinstallsquid* 2.squid配置文件 /etc/squid/squid.conf 3.squid操作 servicesquidstart/stop/restart 4.重新加载配置文件 squid-kreconfig 二.Squid常用配置项 #开启 http_port 192.168.10.1:3128 #设置使用内存大小 cache_mem 64 MB #缓存对象大小 maximum_object_size 4096 KB

ZendFramework中使用Cache缓存机制

如下图所示建立工程: 代码如下: 1.<?php2.3./**4. * IndexController - The default controller class5. *6. * @author7. * @version8. */9.10.require_once 'Zend/Controller/Action.php';11.require_once 'Zend/Cache.php';12.require_once 'Zend/Registry.php';13.require_once 'Z

Squid搭建反向代理提高网站访问速度

反向代理简述: 反向代理服务器有两种传输模式: 1.同步模式:(如:squid)用户发起请求,请求立即被转到后端的服务器,于是在浏览器和后端服务器之间就建立了一个连接,在请求完成前这个连接是一直存在的. 2.异步模式:(如:nginx)用户发起的请求会发送到nginx,nginx接收到所有的数据后在转发到后端的服务器,后端服务器处理完成后把数据返回给nginx,nginx在返回给用户. 由此可见如果用户发起的请求的数据比较大,或者用户端的网速比较慢,同步模式时后端服务器的连接数相对于异步模式会比