Re: [squid-users] File Descriptors causing an issue in OpenBSD

From: Tek Bahadur Limbu <teklimbu@dont-contact.us>
Date: Fri, 10 Aug 2007 17:52:19 +0545

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 10 Aug 2007 01:17:21 +0530
Preetish <preetish.tripathi@gmail.com> wrote:

> > >Odd.. are you sure you are really running the new binary, and that the
> > >ulimit setting is done correctly in the start script?
>
> #Squid startup/shutdown
>
> if [ -z $1 ] ; then
> echo -n "Syntax is: $0 start stop"
> exit
> fi
>
> if [ $1 != start -a $1 != stop ]; then
> echo -n "Wrong command"
> exit
> fi
>
> if [ -x /usr/local/sbin/squid ]; then
> if [ $1 = 'start' ] ; then
> echo -n 'Running Squid: ';ulimit -HSn 8192;
> /usr/local/sbin/squid
> else
> echo -n 'Killing Squid: '; /usr/local/sbin/squid
> -k shutdown
> fi
> else
> echo -n 'Squid not found'
> fi
>
>
> d> What do you get when you issue the following 2 commands:
> > limits
> No command limit.
> > and
> >
> > ulimit -n
>
> 1024

Hi Preetish,

That shows that you have only 1024 file descriptors available on your system.
In my FreeBSD machines, I usually don't have to adjust file descriptors because the defaults are more than I need (7000 - 14000).

>
> > kern.maxfiles
> > kern.maxfilesperproc
>
> i did
> sysctl -w kern.maxfiles=8192
> sysctl -w kern.maxfilesperproc=8192 ---> this gives a error

I guess you don't have the kern.maxfilesperproc variable.

What do you have for your kern.maxusers variable?

If nothing helps, you may have to re-compile your kernel with the following added parameter:

option MAXFILES=8192

But still, I think that there are other ways to increase your file descriptors besides re-compiling your kernel.

You can ask for help in the openbsd mailing list regarding your problem.

>
> Then i even made changes the Options in /etc/login.def
> {{
> default:\
> :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin:\
> :umask=022:\
> :datasize-max=512M:\
> :datasize-cur=512M:\
> :maxproc-max=512:\
> :maxproc-cur=64:\
> :openfiles-cur=8192:\
> :stacksize-cur=4M:\
> :localcipher=blowfish,6:\
> :ypcipher=old:\
> :tc=auth-defaults:\
> :tc=auth-ftp-defaults:
> }}
>
> and
>
> {{
> daemon:\
> :ignorenologin:\
> :datasize=infinity:\
> :maxproc=infinity:\
> :openfiles-cur=8192:\
> :stacksize-cur=8M:\
> :localcipher=blowfish,8:\
> :tc=default:
> }}
>
> and after doing all these changes i uninstalled squid completely and
> all its file and everything .Then recompiled it and installed it
> again....But DAMM it gave me the same number of file descriptors. So
> now i have reduced the cache to 10 GB. I found a Squid Definitive
> guide where he said to recompile the kernel after editing the kernel
> configuration file .

Reducing just the size of your cache may not be able to help you much with your file descriptors limit.

>
>
> Squid Object Cache: Version 2.6.STABLE13
> Start Time: Thu, 09 Aug 2007 19:09:36 GMT
> Current Time: Thu, 09 Aug 2007 19:11:13 GMT
> Connection information for squid:
> Number of clients accessing cache: 321
> Number of HTTP requests received: 2649
> Number of ICP messages received: 0
> Number of ICP messages sent: 0
> Number of queued ICP replies: 0
> Request failure ratio: 0.00
> Average HTTP requests per minute since start: 1638.4
> Average ICP messages per minute since start: 0.0
> Select loop called: 34876 times, 2.782 ms avg
> Cache information for squid:
> Request Hit Ratios: 5min: 15.1%, 60min: 15.1%
> Byte Hit Ratios: 5min: 29.4%, 60min: 29.4%
> Request Memory Hit Ratios: 5min: 9.7%, 60min: 9.7%
> Request Disk Hit Ratios: 5min: 44.4%, 60min: 44.4%
> Storage Swap size: 23806 KB
> Storage Mem size: 2516 KB
> Mean Object Size: 7.57 KB
> Requests given to unlinkd: 0
> Median Service Times (seconds) 5 min 60 min:
> HTTP Requests (All): 0.68577 0.68577
> Cache Misses: 1.24267 1.24267
> Cache Hits: 0.00179 0.00179
> Near Hits: 0.68577 0.68577
> Not-Modified Replies: 0.00091 0.00091
> DNS Lookups: 0.00190 0.00190
> ICP Queries: 0.00000 0.00000

- From your above data, your service response times which are under 1.5 seconds are good figures for a satellite link. Before, it was 15 seconds! Considering that, your proxy server is much faster now. But since your data above is only 2 minutes old, you have to monitor in regularly for a longer period of time.

Starting with a cache_dir size of 10GB is good start. You can later increase it's size based upon your needs and demands.

Thanking you...

>
>
> :(((((((((((((((((((
>
> Preetish
>

- --

With best regards and good wishes,

Yours sincerely,

Tek Bahadur Limbu

(TAG/TDG Group)
Jwl Systems Department

Worldlink Communications Pvt. Ltd.

Jawalakhel, Nepal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFGvFT0fpE0pz+xqQQRAivZAJ4uEr8k8NN7Y7F3nr9AbJ8EPQDPDwCfZ31D
/YjwZBDZ7vUO5/Fpd7xaGNI=
=K5FR
-----END PGP SIGNATURE-----
Received on Fri Aug 10 2007 - 06:07:17 MDT

This archive was generated by hypermail pre-2.1.9 : Sat Sep 01 2007 - 12:00:03 MDT