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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello All My database recently shu

Status
Not open for further replies.

Murugs

Technical User
Jun 24, 2002
549
US
Hello All
My database recently shutdown with the foll error. Whats the remedy..I am totally new to PostgreSQL.

NOTICE: Message from PostgreSQL backend:NOTICE: Message from PostgreSQL backend:
The Postmaster has informed me that some other backendThe Postmaster has informed me that some other backend
NOTICE: Message from PostgreSQL backend:died abnormally and possibly died abnormally and possibly corrupted shared memory.
I have rolled back the current transaction and am going to terminate your database system connection and exit.
Please reconnect to the database system and repeat your query.

DEBUG: all server processes terminated; reinitializing shared memory and semaphores
IpcMemoryCreate: shmget(key=5432001, size=1441792, 03600) failed: Not enough core

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 1441792 bytes), reducePostgreSQL's shared_buffers parameter (currently 64) and/or its max_connections parameter (currently 32).
 
You need to modify the main postgresql.conf file, which is usually at /usr/local/pgsql/data/postgresql.conf. Just change the parameters mentioned in the error message. If any parameter is not in there, or if it is commented out, that means it is using the default value. Just place or uncomment the parameter in there as "shared_buffers = 32", etc...

What are the specs on your server, by the way? -------------------------------------------

Big Brother: "War is Peace" -- Big Business: "Trust is Suspicion"
(
 
part of my conf file looks like this.

# Connection Parameters
#
#tcpip_socket = false
#ssl = false

#max_connections = 32

#port = 5432
#hostname_lookup = false
#show_source_port = false

#unix_socket_directory = ''
#unix_socket_group = ''
#unix_socket_permissions = 0777

#virtual_host = ''

#krb_server_keyfile = ''


#
# Shared Memory Size
#
#shared_buffers = 64 # 2*max_connections, min 16
#max_fsm_relations = 100 # min 10, fsm is free space map
#max_fsm_pages = 10000 # min 1000, fsm is free space map
#max_locks_per_transaction = 64 # min 10
#wal_buffers = 8 # min 4
 
Sorry, I meant RAM, processor, hard drive speed, etc...

Anyway, I will explain the conf file a little more, in case you are unfamiliar with this: Notice that shared_buffers = 64 is commented out with a # at the beginning. When this file is first built by Postgres, it creates each line of configuration, to show you the default values, but leaves them commented out, because defaults don't need a configuration line. Also, there is some more information in an additional comment after many of these directives. You only need an uncommented line if you are changing from the default.

It's always a good idea to preserve the default setting for future reference, so don't uncomment that line; just place another line underneath it:

Code:
#shared_buffers = 64        # 2*max_connections, min 16
shared_buffers = 32

Now, the comment afterwards mentions max_connections, saying that shared_buffers should be approx two times that number. So, you might want to add your max_connections line, setting it at 16.

This should take care of your immediate problem, unless there is really some sort of hardware problem on your system.

The reason I am asking for your machine specs is that PostgreSQL defaults to a fairly conservative configuration, so to be forced to reduce these settings even further indicates that you are using a fairly low-powered machine, or that the kernel configuration is not right. PostgreSQL should work fine, even with lower settings than this, but don't expect to run a serious production system with these settings.

Spend some time at [URL unfurl="true"]http://techdocs.postgresql.org/,[/URL] which is a treasure trove of information. There are several articles here about performance tuning, which is critical with PostgreSQL, if you really want to use it seriously. (not important for a dev/testing box, but for production). Also, you can get some great info by searching through 5 years of mail support at [URL unfurl="true"]http://archives.postgresql.org/[/URL] or the newsgroups at [URL unfurl="true"]http://groups.google.com/groups?hl=en&group=comp.databases.postgresql[/URL]  -------------------------------------------

Big Brother: "War is Peace" -- Big Business: "Trust is Suspicion"
([URL unfurl="true"]http://www.cl.cam.ac.uk/~rja14/tcpa-faq.html)[/URL]
 
Hello Rycamor
Thanks for the timely help and I have modified my conf file.
My system specs are

windows 2000 service pack3
1GB RAM
2 CPU 1.80GHz
2 33 Gig Hard Disk

Thanks
MP
 
Also I run cygwin and could you explain me how to setup a cron job daily at aroound 11.00 PM to take a backup of my database.
pg_dump testdb > backup.dmp

Thanks
MP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top