LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Value of shmmni (https://www.linuxquestions.org/questions/linux-newbie-8/value-of-shmmni-843722/)

d072330 11-11-2010 12:11 PM

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.

Thanks

MensaWater 11-12-2010 07:36 AM

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.

d072330 11-15-2010 05:53 PM

Thanks
 
That was the type of answer I was looking for.


All times are GMT -5. The time now is 09:45 AM.