How to increase semaphore value in linux?

What is semaphore ?


Semaphore can be described as counters used to control access to shared resources by multiple processes, They are most often used as a locking mechanism to prevent processes from accessing a particular resource while another process is performing operations on it.

Semaphore can be used when number of processes try to access the shared resource or same file,Semaphore stored in kernel, so that it can be accessed by all the processes,

  •  Semaphore can be identified unique id in linux kernel and it can be deleted using semdelete function,
  • semaphore values can be incremented or decremented by using functions wait and signal,   
  • If we are using ONFS (Oracle over network file system) in linux, we need to increase the kernel.sem value to improve system performance

How to Increase semaphore value in linux?

To increase semaphore value we need to increase the value of kernel.sem.

[root@server ~]# sysctl -A | grep kernel.sem
kernel.sem = 250        32000   32      128

[root@server ~]# ipcs -ls

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

Increase semop value from 32 to 100, it can be increased upto 250 which is equal to semaphores per array,

Add the following line into /etc/sysctl.conf file,

#vi /etc/sysctl.conf

kernel.sem = 250 32000 100 128

or 

#sysctl -w "kernel.sem = 250 32000 100 128"

or

#sysctl -w "kernel.sem=4096 512000 1600 2048" 
   

kernel.sem: max_sem_per_id max_sem_total max_ops_sem_call max_sem_ids

Now we have modified the kernel.sem value,

Please run the following command to update the changes 

[root@server ~]# sysctl -p

Now semaphore value got changed on server.you can verify using ipcs command.

Post a Comment

28 Comments

  1. When one conceives the issue at hand, i have to agree with your endings. You intelligibly show cognition about this topic and i have much to learn after reading
    your post.Lot's of greetings and i will come back for any further updates.

    Cloud Hosting

    ReplyDelete
  2. "Hi There,

    This is indeed great! But I think perhaps you are generally referring How to Install Debian 9 Stretch? which is getting unsustainable.

    I hate windows and want to switch to Linux (i've already tried it several times and love it), but i don't know wich linux distro to choose.
    Very useful post !everyone should learn and use it during their learning path.

    Regards,
    Preethi
    "

    ReplyDelete
  3. Regular visits listed here are the easiest method to appreciate your energy, which is why why I am going to the website everyday, searching for new, interesting info. Many, thank you!

    Data Science Course

    ReplyDelete
  4. Impressive. Your story always bring hope and new energy. Keep up the good work.

    Data Science Training

    ReplyDelete
  5. After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.
    Data Science Training Institute in Bangalore

    ReplyDelete
  6. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
    Best Data Science Courses in Bangalore

    ReplyDelete
  7. Terrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. In fact, educating the participants with it's amazing content. Hope you share the similar content consecutively.

    360DigiTMG Data Analytics Course

    ReplyDelete
  8. Extraordinary blog filled with an amazing content which no one has touched this kid of subject before. Thanking the blogger for all the terrific efforts put in to develop such an awesome content. Expecting you to deliver similar contents further too and keep sharing as always.

    360DigiTMG PMP Certification Course

    ReplyDelete
  9. I will really appreciate the information provided on the blog was of great help.
    Data Analytics Course Online 360DigiTMG

    ReplyDelete
  10. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai

    Python Training in Chennai Python Training in Chennai The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai

    ReplyDelete
  11. You have completed certain reliable points there. I did some research on the subject and found that almost everyone will agree with your blog.
    Data Science Training in Pune

    ReplyDelete
  12. Really impressed! Everything is a very open and very clear clarification of the issues. It contains true facts. Your website is very valuable. Thanks for sharing.
    Data Science Institute in Bangalore

    ReplyDelete
  13. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    best data science courses in bangalore

    ReplyDelete
  14. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    data scientist course in bangalore

    ReplyDelete
  15. I Want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging endeavors.
    data science certification in banagalore

    ReplyDelete
  16. I bookmarked your website because this site contains valuable information. I am very satisfied with the quality and the presentation of the articles. Thank you so much for saving great things. I am very grateful for this site.

    Data Analytics Course in Bangalore

    ReplyDelete
  17. Writing in style and getting good compliments on the article is hard enough, to be honest, but you did it so calmly and with such a great feeling and got the job done. This item is owned with style and I give it a nice compliment. Better!

    Digital Marketing Course in Bangalore

    ReplyDelete
  18. I am sure it will help many people. Keep up the good work. It's very compelling and I enjoyed browsing the entire blog.

    Business Analytics Course

    ReplyDelete
  19. It took a while to understand all the comments, but I really enjoyed the article. It turned out to be really helpful for me and I'm positive for all the reviewers here! It's always nice to be able to not only be informed, but also entertained! I'm sure you enjoyed writing this article.

    Best Data Science Courses in Bangalore

    ReplyDelete
  20. I am glad to discover this page. I have to thank you for the time I spent on this especially great reading !! I really liked each part and also bookmarked you for new information on your site.
    Data Science Training in Chennai

    ReplyDelete
  21. A good blog always contains new and exciting information and as I read it I felt that this blog really has all of these qualities that make a blog.
    Best Data Science Courses in Bangalore

    ReplyDelete
  22. It's good to visit your blog again, it's been months for me. Well, this article that I have been waiting for so long. I will need this post to complete my college homework, and it has the exact same topic with your article. Thanks, have a good game.
    Business Analytics Course

    ReplyDelete
  23. I bookmarked your website because this site contains valuable information. I am very satisfied with the quality and the presentation of the articles. Thank you so much for saving great things. I am very grateful for this site.

    Data Analytics Course in Bangalore

    ReplyDelete
  24. I bookmarked your website because this site contains valuable information. I am very satisfied with the quality and the presentation of the articles. Thank you so much for saving great things. I am very grateful for this site.


    Digital Marketing Course in Bangalore

    ReplyDelete