Skip site navigation (1) Skip section navigation (2)

Postgres stopped running (shmget failed)

From: Don Drake <dondrake(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Postgres stopped running (shmget failed)
Date: 2005-01-25 15:10:50
Message-ID: 6c21003b05012507104989efed@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
My db server is running under high load recently and the number of
connections during the morning hours is actually very high.

This morning I found the postgres not running and the following in my log file:

DETAIL:  The postmaster has commanded this server process to roll back
the current transaction and exit, because another server process
exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.
2005-01-25 01:38:00 WARNING:  terminating connection because of crash
of another server process
DETAIL:  The postmaster has commanded this server process to roll back
the current transaction and exit, because another server process
exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.
2005-01-25 01:38:05 WARNING:  terminating connection because of crash
of another server process
DETAIL:  The postmaster has commanded this server process to roll back
the current transaction and exit, because another server process
exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.
2005-01-25 01:38:16 LOG:  all server processes terminated; reinitializing
2005-01-25 01:38:22 FATAL:  could not create shared memory segment:
Cannot allocate memory
DETAIL:  Failed system call was shmget(key=5432001, size=273383424, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space. To reduce the
request size (currently 273383424 bytes), reduce PostgreSQL's
shared_buffers parameter (currently 32768) and/or its max_connections
parameter (currently 40).
        The PostgreSQL documentation contains more information about
shared memory configuration.
2005-01-25 08:00:07 LOG:  database system was interrupted at
2005-01-25 00:30:15 CST

I'm confused to as to what is the problem.  My shared memory kernel
setting are as follows:
[root(at)katie data]# tail /etc/sysctl.conf

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# For POSTGRESQL -Drake 8/1/04
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128

[root(at)katie data]# cat /proc/sys/kernel/shmall
2097152
[root(at)katie data]# cat /proc/sys/kernel/shmmax
1073741824

Here's my ipcs output after restarting the server:
[root(at)katie data]# ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x0052e2c1 196608     postgres  600        273383424  11                      

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0x0052e2c1 589824     postgres  600        17        
0x0052e2c2 622593     postgres  600        17        
0x0052e2c3 655362     postgres  600        17        

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    

I have 2GB of RAM, is this telling me I need more RAM?  There are some
other processes running on this server besides postgres.

Thanks.

-Don
-- 
Donald Drake
President
Drake Consulting
http://www.drakeconsult.com/
312-560-1574

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2005-01-25 15:41:53
Subject: Re: PostgreSQL clustering VS MySQL clustering
Previous:From: Tatsuo IshiiDate: 2005-01-25 14:19:17
Subject: Re: PostgreSQL clustering VS MySQL clustering

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group