Optimizing Your Linux Kernel for Heavy Usage

This is something I found while searching for a solution to file table overflow messages on AltaVista.

| From: "Michael K. Johnson" 
| Subject: Re: file table overflow
| X-Mailing-List:  archive/latest/2216
| Resent-Sender: rembrandt-list-request@redhat.com
| X-URL: http://www.redhat.com
|
| BearHeart / Bill Weinman writes:
| >       Occasionally I'm getting a message from Sendmail:
| > 
| >          Who are you? File table overflow.
| > 
| >       I also get some file table overflow messages in other places.
|
| bearheart@bearnet.com also said:
| >     I keep getting this message on my console (and in my logs)  that
| >  says:
| > 
| >        Unable to load interpreter
| > 
| >     What is that?
|
| Both of these problems are related.  They happen only on heavily-loaded
| machines; soft limits in the kernel are being exceeded.
|
| These two lines added to rc.sysinit or rc.local should solve your
| problem:
| echo "4096" > /proc/sys/kernel/file-max
| echo "12288" > /proc/sys/kernel/inode-max
| If they don't, make them larger.  Just keep inode-max three times as
| large as file-max (suggested by a kernel source code comment...)
|
| You might also want to do this if you ever get "out of memory"
| messages from device drivers:
| echo 300 400 500 > /proc/sys/vm/freepages
| We use that line on machines with very heavy network traffic.
|
| michaelkjohnson


Here's a link off of the Apache web site that has some additional parameters to tweak in /usr/src/linux/include/linux/ :
http://www.qosina.com/~awm/apache/linux-tcp.html

Here's something I found from grepping through kernel code:

In /usr/src/linux/include/linux/tasks.h :

change
        #define NR_TASKS        256
to
        #define NR_TASKS        1024
since
        #define MAX_TASKS_PER_USER (NR_TASKS/2)

Remember, if you have any corrections, additions, or suggestions, Email us!

World | Inch