Hi,
I'm having a problem with the memory usage of Squid (v1.1.6 and
v1.1.8) on our Top-level Web caching server (an AlphaServer-4000 with
Digital Unix v4.0a).
I've configured cache_mem=12 and cache_swap=6400 and the Squid process
is still using nearly 230-MByte of memory.. This causes Squid and some
other (memory hungry processes) to swap causing a severe regression of
the performance ...
What can I do to minimize the memory usage of Squid?? May it be better
to have no memory cache at all and to have Squid fetsh all the files from
disk ??
What we do here is using a simple shellscript, ugly but
effective:
#!/bin/sh
# $Id: squid.check,v 1.2 1997/02/28 11:52:51 hans Exp $
#
# checks if the squid process is not growing beyond $max Mb
# If so, restart the squidprocess.
max=235000
stop=/usr/local/etc/squid.scripts/squid.stop
pid=`cat /etc/squid.pid`
if kill -0 "$pid"; then
:
else
exit 1
fi
usage=`ps axuh $pid | awk '{print $5}'`
[ "$usage" = "" ] && exit 0
if [ "$usage" -gt $max ]; then
(
echo "squid will be stopped:"
echo "memory usage is above maximum $max"
echo "It will startup again in 30 seconds."
echo
ps axu | grep 'squid -sY' | head -1 | grep -v grep
$stop
) | mail -s "`hostname`: squid restarted" cacheadmin@some.domain
fi
You will probably need to adjust the 'ps' and the vars defined
above.
- hans
Received on Wed Mar 05 1997 - 05:01:15 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:37 MST