Re: [HACKERS] Error: shmget failed - SOLVED! - Mailing list pgsql-hackers

From Roberto Joao Lopes Garcia
Subject Re: [HACKERS] Error: shmget failed - SOLVED!
Date
Msg-id 3.0.5.32.19991027102057.008298f0@pop.hipernet.com.br
Whole thread Raw
In response to Re: [HACKERS] Error: shmget failed  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Hi

To change maximun Shared Memory segment size in my Sparc Solaris 2.5, I
have to add the following line into /etc/system file and then reboot the
system
set  shmsys:shminfo_shmmax=268435456

It solved the problem. 

Also, Solaris ANSWER BOOK recomends to change the follow. Please note that
I do not test the lines bellow in my system, only the above change in
/etc/system solved the problem.
set  semsys:seminfo_semmap=250set  semsys:seminfo_semmni=500set
semsys:seminfo_semmns=500set  semsys:seminfo_semmsl=500set
semsys:seminfo_semmnu=500set  semsys:seminfo_semume=100set
semsys:seminfo_shmmin=200set  semsys:seminfo_shmmni=200set
semsys:seminfo_shmseg=200

To see the actual system sets one can use the command sysdef that, in my
system produce the follow:

#sysdef... ...
*
* IPC Semaphores
*   10    entries in semaphore map (SEMMAP)   10
semaphore identifiers (SEMMNI)   60    semaphores in system (SEMMNS)   30
undo structures in system (SEMMNU)   25    max semaphores per id (SEMMSL)
10    max operations per semop call (SEMOPM)   10    max undo entries per
process (SEMUME)32767    semaphore maximum value (SEMVMX)16384    adjust on
exit max value (SEMAEM)
*
* IPC Shared Memory
*
268435456    max shared memory
segment size (SHMMAX)    1    min shared memory segment size (SHMMIN)  100
shared memory identifiers (SHMMNI)    6    max attached shm segments per
process (SHMSEG)
*
* Time Sharing Scheduler Tunables
*
60    maximum time
sharing user priority (TSMAXUPRI)
SYS    system class name (SYS_NAME)
# 

Please read the man pages before execute this command or the changes showed
above.

Thank you for you help

Roberto

At 12:51 26/10/99 -0400, you wrote:
>> Roberto Joao Lopes Garcia <roberto@mha.com.br> writes:
>> > I tried to start postmaster and it report an error, see bellow:
>> > IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
>> > size=1073152, permission=600
>> > FATAL 1:  ShmemCreate: cannot create region
>> 
>> As a quick hack you can start the postmaster with smaller-than-
>> normal -B and -N (say -B 40 -N 20).  Long term solution is to
>> increase your kernel's SHMMAX limit to more than 1 megabyte.
>> 
>> I thought we had adjusted the default -B and -N to stay just
>> under a meg, which is the default SHMMAX value on many kernels.
>> But it looks like someone chewed up some more shared memory when
>> I wasn't looking :-(.
>
>7.0 backend will point them to FAQ on such errors.
>
>-- 
>  Bruce Momjian                        |  http://www.op.net/~candle
>  maillist@candle.pha.pa.us            |  (610) 853-3000
>  +  If your life is a hard drive,     |  830 Blythe Avenue
>  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
>
>************
>
>



pgsql-hackers by date:

Previous
From: Keith Parks
Date:
Subject: Syntax error in psqlHelp.h
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Function-manager redesign: second draft (long)