squid and bsdi

From: Peter Matthews <pjmatt@dont-contact.us>
Date: Tue, 3 Jun 1997 10:00:25 +0930 (CST)

Re: your mail to the squid mailing list

> G'day,
> I used bsdi v 2.1 with squid 1.1.9. I have 2.5gb cache and 128 mb
> allocated to cache_mem. I have 163 Mb ram. (recently put in). Now the

Is that your cache_mem setting in squid.conf?? If so drop it back to 16
or so. That figure is only for caching "hot" objects - you don't want it
that high....

> problem is that once squid gets to 65mb or there abouts, it runs out of
> memory and the malloc error unable to allocate 40xx bytes comes on my
> console.
>
> (This 66 mb figure it the amount or ram the machine had prior to the
> upgrade)
>
> I've tried rebooting the machine, but it still stops at this 65Mb mark!
>
> Anyone have any ideas?

cd to /sys/i386/conf and edit your kernel config file. Set maxusers to 256.

Add these options:
options NMBCLUSTERS=4096
options NKMEMCLUSTERS=4096
options "KMEMSIZE=\(16*1024*1024\)"
options "DFLDSIZ=\(64*1024*1024\)"
options "DFLSSIZ=\(4*1024*1024\)"
options "MAXDSIZ=\(96*1024*1024\)"
(feel free to tweak and poke them a bit)...

Recompile your kernel, and keep a backup of your old one of course..

Next, install gnu malloc. The distribution I had compiled libmalloc.a or
some such - rename it to libgnumalloc.a, and move it and gmalloc.o to
/usr/lib.

Then recompile squid. You'll find it much more robust.

I run a script called checksquid every minute, and use it to start squid
on boot too. I find it dies very rarely:

#!/bin/sh
date=`/bin/date`
if ps -ax | grep squid | grep -v grep | grep -v checksquid > /dev/null
then
        exit
else
        unlimit datasize
        limit maxproc 4096
        limit openfiles 10240
        echo restarting squid with new limits
        /usr/local/squid/bin/squid -sY &
        echo restart $date >> /var/log/squid.log
        #limit >> /var/log/squid.log
fi

Feel free to play with those limits too. I find the above works for me.

 Peter Matthews - Network Manager - pjmatt@dove.net.au
   ,- __ -,
  / \___/ /__ _ _____/ \ "To err is human - to really
 / _ / _ / _ \ |/ / -_) _ \ screw things up requires the
/.- \_,_/\___/___/\__/ -.\ root password"
       A U S T R A L I A "Carpe Carpem-Seize the Fish"
      http://dove.net.au #include <std_disclaimer.h>
Received on Mon Jun 02 1997 - 17:32:29 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:35:21 MST