/proc/sys/kernel/shmmax and shmall

Yong Huang yong321 at yahoo.com
Sat Apr 18 00:01:21 UTC 2009


> What's the rule of thumb when setting these values for shared memory?
> 
> Defaults:
> 
> Shmmax 33554432
> Shmall 2097152
> 
> System has 12GB of physical ram.

The software that requires shared memory, e.g. Oracle, should have recommended values. When I set up Oracle, I don't bother to set shmall, but set shmmax to the same as physical memory. In fact, you can set shmmax to any arbitrary number with no harm; I think it's just a mathematical limit shmget() checks to see if the desired shared memory segment is larger than shmmax, with no other checking afterward. But shmall shouldn't be arbitrarily set.

If your shmmax is too small, the shared memory segment you want is created as multiple fragments, which slightly affect performance when it's used.

Yong Huang



      




More information about the redhat-list mailing list