Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IPC settings?

Status
Not open for further replies.

DZH

Programmer
Apr 12, 2002
26
ZA
I have an application that makes heavy use of IPCs for message passing between a producer and multiple consumers. The producer app picks data from the DB and puts them on a queue. The program creates a shared memory segment for each item placed on the message queue. The problem is that, given 5000 records the program processes up to 1074 records and fails to allocate shared memory for the remainder.

I'm running on SUN Solaris 5.8.

Here are my current IPC settings:

*
* IPC Messages
*
4194304000 max message size (MSGMAX)
4194304000 max bytes on queue (MSGMNB)
1000 message queue identifiers (MSGMNI)
65534 system message headers (MSGTQL)
*
* IPC Semaphores
*
32767 semaphore identifiers (SEMMNI)
32767 semaphores in system (SEMMNS)
8192 undo structures in system (SEMMNU)
8192 max semaphores per id (SEMMSL)
8192 max operations per semop call (SEMOPM)
8192 max undo entries per process (SEMUME)
32767 semaphore maximum value (SEMVMX)
16384 adjust on exit max value (SEMAEM)
*
* IPC Shared Memory
*
4294967295 max shared memory segment size (SHMMAX)
1 min shared memory segment size (SHMMIN)
32767 shared memory identifiers (SHMMNI)
32767 max attached shm segments per process (SHMSEG)


Is there any way I can modify the above parameters so that the app succeeds in allocating enough shared memory for processing?

Any assistance is highly appreciated.
 
MSGMNI sounds very close to the limit you're hitting?

To change that one, for example, you would add:

[tt]set msgsys:msginfo_msgmni=65536[/tt]

... for example, to your /etc/system file and reboot.

Use semsys:seminfo_... and shmsys:shminfo_... for the semaphore and shared memory parameters respectively. Annihilannic.
 
Would you, please, explain the following part:


Use semsys:seminfo_... and shmsys:shminfo_... for the semaphore and shared memory parameters respectively.


In addition, given that the program fails to allocate a memory block out of the shared memory, is there anything that I need to do as far as the shared memory settings are concerned?
 
I meant if you are changing SEMMNI, SEMMNS, etc, use set semsys:seminfo_semmni=..., and if you're changing SHMMAX, SHMMIN, etc use set shmsys:shminfo_shmmax=.... Does that make sense?

I would suggest that you try and look at the output of ipcs while your programme is running to try and find out what kind of shared memory resources are being used up. You may need to slow down or stop your programme while it is running (by prompting for input perhaps?) to allow you to see this information. Annihilannic.
 
Thanks, Annihilannic, I'll try to make the suggested modifications. I'm hopeful that they'll make a difference.

Have a good day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top