Re: [squid-users] File Descriptor Issue

From: Matthew Ceroni <matthewceroni_at_gmail.com>
Date: Wed, 25 Jun 2014 16:53:36 -0700

Amos:

Thanks for the info. I am using workers so that explains why the
output of mgr:info shows such a high number of file descriptors.

If you don't mind I need some further clarification on the output of
mgr:info. Just to summarize I have a global nofile limit of 8192 and
the squid user is set to a soft limit of 4096 and a hard limit of
8192.

The output of mgr:info contains a statistic "Largest file desc
currently in use" (in my case it shows 3956). What exactly is that
indicating? Would it be safe to assume that at some point in time a
max of 3956 FD were in use (assuming each open FD is given a
incrementing number)?

Also, when squid first starts up it lists the Maximum number of file
descriptors as 65536, but when I get the warning message that my Cache
is low on FD that value changes to 16384. Why is that?

Thanks

On Wed, Jun 25, 2014 at 4:37 AM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> On 25/06/2014 5:01 a.m., Matthew Ceroni wrote:
>> Hi:
>>
>> I am running squid version 3.3.8 on CentOS v6.5.
>>
>> I have an issue regarding file descriptors. Our proxy has run into an
>> issue the past few days (everyone streaming FIFA soccer I believe)
>> where we receive the following error:
>>
>> WARNING! Your cache is running out of filedescriptors
>>
>> At this point the CPU usage of each squid worker spikes to 100% and
>> the SNMP agent becomes unavailable.
>>
>> I was able to get some information from squidclient mgr:info.
>>
>> My question is around the file descriptor statistics:
>>
>> When the issue is happening it reports:
>>
>> File descriptor usage for squid:
>> Maximum number of file descriptors: 16384
>> Largest file desc currently in use: 548
>> Number of file desc currently in use: 540
>> Files queued for open: 0
>> Available number of file descriptors: 15844
>> Reserved number of file descriptors: 100
>> Store Disk files open: 0
>>
>> After a restart of squid it reports the following:
>>
>> File descriptor usage for squid:
>> Maximum number of file descriptors: 65536
>> Largest file desc currently in use: 516
>> Number of file desc currently in use: 475
>> Files queued for open: 0
>> Available number of file descriptors: 65061
>> Reserved number of file descriptors: 400
>> Store Disk files open: 0
>>
>>
>> The ulimit setting for the OS is 8192 for open files. According to the
>> documentation for max_filedescriptors (which I don't have set in my
>> squid.conf) the default value is the ulimit value. Therefore why on
>> first startup does it list the max FD of 65k? Also, when the issue
>> arises why does it end up dropping to 16k? According to the output
>> above there is at any point roughly only 1k FD in use, so why is squid
>> reporting that it is running out of FD?
>>
>
> On system startup the user initiating Squid is "root". The set of FD
> limits applicable to root user are used. On later actions the proxy
> low-privilege user account is used and a different set of limits apply
> there.
> The squid.conf directive value can be set if it is either smaller than
> the limit the user account permits, OR if the user account has
> permission to raise the value.
>
> There are also undetermined questions about whether there are bugs in
> the logic finding the FD limit.
>
>
>
> PS. are you running with SMP workers? The 3.3 squid versions display FD
> numbers summing the workers FD limits together and the log entry is made
> if any one worker (or disker) reaches capacity.
>
> Amos
Received on Wed Jun 25 2014 - 23:53:50 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 26 2014 - 12:00:05 MDT