Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-11-2010, 12:11 PM   #1
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Rep: Reputation: 6
Value of shmmni

Currently we have a system that has 4800 shared memory segments by doing a ipcs -m. I wrote a perl script to add up the nattch column and that is where the 4800 number came from. The default value is 4096. I can increase this on the fly without a reboot and I can add it to the /etc/sysctl.conf file for future use.

My question is what happens to the system when you go over the alloted value of shmmni? Will this effect logins, software etc etc?

I don't understand how it can over a max value unless defunct processes are counted in the ipcs -m command but are not actually a count.

Any help would be appreciated.


Last edited by d072330; 11-11-2010 at 01:44 PM.
Old 11-12-2010, 07:36 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,497
Blog Entries: 15

Rep: Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463
nattch is number of attachments. shmmni is number of shared memory identifiers. You can have multiple attachments (and often will) to a single identifier. Since shared memory is designed for interprocess communication (ipc) it would be useless if it only allowed for one attachment.

Typically if you ran out of available identifiers you'd see "shmget" errors (either on application start or in logs).

Not everything uses shared memory segments (don't confuse this with shared libraries and the like which is a different kind of sharing to eliminate having multiple copies of the same library in memory). As noted above Shared Memory is one of the 3 types of IPC (the others being semaphores and message queues). Standard logins aren't going to be using shm. The heaviest use of shared memory is typically done by databases (often they'll use a semaphore/shared memory segment combination to make unique "queues" which should not be confused with message queues).

Finally note that nattch only shows you current attachments. Other processes may attach or detach over time. This is why you shouldn't remove a shared memory segment unless your entirely sure the application that created it is completely down.
Old 11-15-2010, 05:53 PM   #3
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Original Poster
Rep: Reputation: 6

That was the type of answer I was looking for.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration