Securing-Optimizing-RH-Linux-1_2_344
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
344
We change the default location of cache.log, access.log, and store.log files to be located
under /var/log/squid directory, then we put the pid file of Squid under /var/run directory and
finally locate the icons directory of Squid under /usr/lib/squid/icons with the variable (libexecdir)
above.
Using GNU malloc library to improve cache performance of Squid
If you're suffering of memory limitation in your system, the cache performance of Squid will be
affected. To reduce this problem, you can link Squid with an external malloc library such as GNU
malloc. To make Squid use GNU malloc as an external library follows these simple steps:
Packages
GNU malloc Homepage: http://www.gnu.org/order/ftp.html
You must be sure to download: malloc.tar.gz
[root@deep /]# cp malloc.tar.gz /var/tmp
[root@deep /]# cd /var/tmp
[root@deep tmp]# tar xzpf malloc.tar.gz
Step 1
Compile and install GNU malloc in your system by executing the following commands:
[root@deep tmp]# cd malloc
[root@deep malloc]# export CC=egcs
[root@deep malloc]# make
Step 2
Copy the libmalloc.a file to your system library directory and be sure to name it libgnumalloc.a.
[root@deep malloc]# cp libmalloc.a /usr/lib/libgnumalloc.a
Step 3
Copy the malloc.h file to your system include directory and be sure to name it gnumalloc.h.
[root@deep malloc]# cp malloc.h /usr/include/gnumalloc.h
With the files libgnumalloc.a and gnumalloc.h installed in your system, Squid will detect them
automatically during its compile time and will use them to improve its cache performance.
Compile and Optimize
Step 1
Return into the new Squid directory and type the following commands on your terminal:
CC="egcs" \
CFLAGS="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -fomit-
frame-pointer -fno-exceptions" \
./configure \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/sbin \
--libexecdir=/usr/lib/squid \
--localstatedir=/var \
--sysconfdir=/etc/squid \
--enable-delay-pools \