Re: [squid-users] optimizing squid and FreeBSD

From: Tek Bahadur Limbu <teklimbu@dont-contact.us>
Date: Sun, 18 Mar 2007 13:41:19 +0545

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

On Sat, 17 Mar 2007 14:50:12 -0400
"Dave" <dmehler26@woh.rr.com> wrote:

> Hello,
> Running squid on a 6.x box. I'm going to implement digest user
> authentication, and want to ensure squid is running optimally. Googling and
> reading "Squid the Definitive Guide" by Oreilly indicates that the file
> descriptors should be raised. I did a
>
> sysctl -a|grep maxfiles
>
> and found a value of 1440. It was suggested to increase this to 8192, which
> i did. I then found entries in /etc/login.conf that make me wonder if this
> change was necessary. All of these are set to unlimited in the default
> option: datasize, stacksize, memoryuse, filesize and openfiles (one of these
> the descriptors), maxproc, and Given this do i have to add an
> options maxfiles=8192

Hi Dave,

You can add kern.maxfilesperproc=8192 in /etc/sysctl.conf to increase your squid file descriptors to 8192.
You may also have to change your kern.maxfiles parameter to say about 8192 or 16384.

> in my kernel config file? I've also read the wiki in particular the section
> on diskd, i'm using the ufs storage scheme, would it help if i implemented
> diskd? Any other suggestions welcome.

Well if your proxy serves less than 30 requests per second, then ufs storage is fine. However if your demands are above 30 requests per second, then either diskd and aufs will be good. However you may need to tweak your kernel to implement diskd for FreeBSD.

Try using these in your kernel config file:

options MSGMNB=8192 # max # of bytes in a queue
options MSGMNI=40 # number of message queue identifiers
options MSGSEG=512 # number of message segments per queue
options MSGSSZ=64 # size of a message segment
options MSGTQL=2048 # max messages in system

options SHMSEG=16
options SHMMNI=32
options SHMMAX=2097152
options SHMALL=4096
options MAXFILES=16384

Also, I really like the COSS storage system in Squid. Even though, the docs and FAQs say that it may not be ready for production servers, I definitely suggest you to try it out.

In fact, I am using it for 2 of my FreeBSD servers which serves about 100 - 200 requests per second. And I have to say that it's really fast and stable. It has not crashed or suffered any kind of problems since the past 4 months. To get the best results, use it in conjunction with either diskd or aufs.

> Thanks.
> Dave.
>
>

- --

With best regards and good wishes,

Yours sincerely,

Tek Bahadur Limbu

(TAG/TDG Group)
Jwl Systems Department

Worldlink Communications Pvt. Ltd.

Jawalakhel, Nepal

http://www.wlink.com.np
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (FreeBSD)

iD8DBQFF/PCjVrOl+eVhOvYRAs0YAKCneYcJcrjOzodWPFfcAR6yqqDiBQCgkrsX
iELE/uU83yC3Fr+rw/7uKGI=
=ZInE
-----END PGP SIGNATURE-----
Received on Sun Mar 18 2007 - 01:56:33 MDT

This archive was generated by hypermail pre-2.1.9 : Sat Mar 31 2007 - 13:00:02 MDT