Linux Tricks and Techniques

For Linux Experts

Use the website for easy leaning of Linux

Wednesday, 8 February 2017

How to Increase the values of Semaphores in Linux

Semaphore is the counter used to control access to shared resource by  multiple processes.




To  increase the value of Semaphore  in Linux follow the below steps.

1) check the current value of semaphore call count using below command.

#ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 100
semaphore max value = 32767



2) Also we can check the same by using.

# sysctl -A | grep kernel.sem

kernel.sem = 250 32000 100 128

3) To increase the value of semaphore call count edit the sysctl.conf file and add the below line as

#vi /etc/sysctl.conf

then add the line 
kernel.sem=400 
and save it

and then reboot the server and once the server is up you can check by using the same command

#ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 400
max semaphores system wide = 32000
max ops per semop call = 100
semaphore max value = 32767

So the value is changed successfully.

Thanks








No comments:
Write comments