Operating System - Linux
1754420 Members
2727 Online
108813 Solutions
New Discussion юеВ

How to Tune Kernerl parameter on Linux?

 
SOLVED
Go to solution
Worapoj P.
Regular Advisor

How to Tune Kernerl parameter on Linux?

Dear all expertise,
Could anyone help how to tune kernel on Linux 6.2 as given parameter,

SEMNI 100
SEMNS 256
SEMMSL 100
SEMOPM 100
SEMVMX 32767
SHMMAX 2147483648
SHMMIN 1
SHMMNI 100
SHMSEG 4096

Thanks in advance for your helps,
Worapoj
For LOVE For Honor For Mankind
6 REPLIES 6
Madhu Sudhan_1
Respected Contributor
Solution

Re: How to Tune Kernerl parameter on Linux?

Hi,

To list kernel parameters : sysctl -a
To set kernel paramters : sysctl -w key=value
Specially for semaphore setting use the key,

kernel.sem="SEMMSL SEMMNS SEMOPM SEMMNI"
to set a value to this parameter,
use kernel.sem="value1 value2 value3 value4"

-Allen.



Think Positive
Worapoj P.
Regular Advisor

Re: How to Tune Kernerl parameter on Linux?

Deaf Allen,

I meant set all of them to permanence, by tune parameter and make new kernel.

Pls advise,
Worapoj

For LOVE For Honor For Mankind
Madhu Sudhan_1
Respected Contributor

Re: How to Tune Kernerl parameter on Linux?

This command makes changes permanently and will be retained even after a reboot. sysctl changes parameters at run time and no kernel rebuild is required.

all the kerenel parameters are available at /proc/sys/kernel

-Allen
Think Positive
Worapoj P.
Regular Advisor

Re: How to Tune Kernerl parameter on Linux?

Dear Allen,

I would like to know the old way which this need to re gennerate new kernel.

Please helps,
Worapoj
For LOVE For Honor For Mankind
Stuart Browne
Honored Contributor

Re: How to Tune Kernerl parameter on Linux?

Linux doesn't require a kernel rebuilt to make such changes. They can be dynamically changed by altering the values as Allen said.

This might cause some confusion if you are used to more main-stream Unicies (ie. I'm familier with SCO which requires /etc/conf/bin/idtune, and then a relink/reboot), but this is NOT the case with Linux.
One long-haired git at your service...
Kodjo Agbenu
Honored Contributor

Re: How to Tune Kernerl parameter on Linux?

Hello,

There are 2 ways to tune kernel parameters on Linux.

1. The "difficult" way : change values in the kernel source, then re-build the kernel.

Rebuilding the kernel is a risky task, and you should not do this unless you know exactly what you are doing. One problem you can have is the way drivers needed to boot the system are loaded (eg : ramdisk).

If you want to learn how to rebuild the kernel, please post another message on this specific topic.


2. The easiest way : change values directly in the running kernel using /proc.
This can be done either directly :

echo "134217728" >/proc/sys/kernel/shmmax

or using the sysctl program (as explained by Allen) :

sysctl -w kernel.shmmax=134217728


You can automate this in system boot-up scripts.
However when using RedHat, this is already done in /etc/rc.d/rc.sysinit. Therefore, the only thing you have to do is edit the /etc/sysctl.conf file to set the parameters like this :

kernel.shmmax=134217728


Good luck.

Kodjo
Learn and explain...