[olug] tweaks
Adam Haeder
adamh at omaha.org
Mon Sep 8 03:01:44 UTC 2003
There was some talk at the last OLUG meeting about tweaks to the system
through /proc. Here is my standard tweaks file that I use on most of my
servers. The bdflush numbers I got from an article somewhere, and the rest
are either unique to me or standard 'better than default' values. I put
this in a file called /etc/rc.d/init.d/tweaks and then call it from
the symlink S01tweaks in /etc/rc.d/rc3.d.
I encourage you to read /usr/src/linux/Documentation/filesystems/proc.txt
for a good explanation of all the fun things you can do with the /proc
filesystem.
echo "40 0 0 0 60 300 60 0 0" > /proc/sys/vm/bdflush
echo "262144" > /proc/sys/net/core/rmem_default
echo "262144" > /proc/sys/net/core/rmem_max
echo "262144" > /proc/sys/net/core/wmem_max
echo "262144" > /proc/sys/net/core/wmem_default
echo "16384 65536" > /proc/sys/net/ipv4/ip_local_port_range
echo "524288" > /proc/sys/net/ipv4/ipfrag_high_thresh
echo "393216" > /proc/sys/net/ipv4/ipfrag_low_thresh
echo "90" > /proc/sys/net/ipv4/ipfrag_time
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "0" > /proc/sys/net/ipv4/conf/all/accept_redirects
echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route
echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
echo "128" >/proc/sys/vm/min-readahead
echo "256" >/proc/sys/vm/max-readahead
echo "65535" > /proc/sys/fs/file-max
And while we're on the subject of tweaks, I'll throw one in here that I
have found personally very handy. I think I got most of this by a post
from Vincent R. many moons ago. I have a couple of servers connected by
NFS that see A LOT of data moving between them. To optimize this, I have
the following settings:
On the server:
In /etc/exports, the line looks like this:
/dir/to/export
192.168.1.0/255.255.255.0(rw,no_root_squash,async,wdelay)
On the client:
The /etc/fstab entry looks like this:
server:/dir/to/export /mnt/server nfs
rsize=8192,wsize=8192,timeo=20,retrans=6,async,rw,noatime,intr 0 0
This has helped me avoid messages like the following in my syslog:
Sep 2 11:59:12 $CLIENT kernel: nfs: server $SERVER not responding, still
trying
Sep 2 11:59:13 $CLIENT kernel: nfs: server $SERVER OK
I still these occasionally, when under high load, but much fewer than with
the default settings.
Cheers
--
Adam Haeder
Assistant Vice President of Information Technology
AIM Institute
adamh at omaha.org
(402) 345-5025 x115
PGP Public key: http://www.omaha.org/~adamh/pgp.html
More information about the OLUG
mailing list