Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9B8CAB5DD52 for ; Tue, 31 May 2011 15:32:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 73203-04 for ; Tue, 31 May 2011 18:31:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 3CCBBB6008B for ; Tue, 31 May 2011 15:31:59 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 31 May 2011 13:31:58 -0500 Message-Id: <4DE4EDC5020000250003DF1B@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 31 May 2011 13:31:49 -0500 From: "Kevin Grittner" To: "Wells Oliver" , "pgsql-admin@postgresql.org" Subject: Re: Server crash... trying to figure it out References: <509F1BCA-2A75-41F4-87F5-EBD098023D71@padres.com> In-Reply-To: <509F1BCA-2A75-41F4-87F5-EBD098023D71@padres.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/186 X-Sequence-Number: 37623 Wells Oliver wrote: > This has happened twice over the last couple of nights: > > 2011-05-30 02:08:27 PDT LOG: server process (PID 29979) was > terminated by signal 9: Killed > 2011-05-30 02:08:31 PDT FATAL: could not create shared memory > segment: Cannot allocate memory > To reduce the request size (currently 6595420160 bytes), reduce > PostgreSQL's shared_buffers parameter [...] > The value of shared_buffers is set to 6GB, work_mem is 64MB, > maintenance_work_mem is 128MB, effective_cache_size is 4GB. > > max_connections is set to 200. > > Any ideas here? The system has 12GB; raising the shared_buffers > seems reasonable but 6GB also feels like it should be sufficient. You're probably overcommitting memory and running afoul of the oom killer. You've got an actual 12MB, but you can easily allocate up to shared_buffers + (user_connections * work_mem), which is 18.5 GB. I would start by reducing shared_buggers to 3GB or less, and cut work_mem in half. Then I would get a connection pooler set up to funnel 200 client-side connections through a pool of 10 or 20 database connections. Then I would try edging up work_mem while monitoring performance and memory usage. -Kevin