Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TH842-0003vj-5v for pgsql-general@postgresql.org; Thu, 27 Sep 2012 06:59:14 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TH840-0002MF-QB for pgsql-general@postgresql.org; Thu, 27 Sep 2012 06:59:13 +0000 Received: from awork2.localnet (p5DDC6844.dip.t-dialin.net [93.220.104.68]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MXovv-1SvI4n3MPf-00WD3x; Thu, 27 Sep 2012 08:59:11 +0200 From: Andres Freund Organization: 2ndquadrant.com To: pgsql-general@postgresql.org Subject: Re: Memory issues Date: Thu, 27 Sep 2012 08:59:09 +0200 User-Agent: KMail/1.13.7 (Linux/3.6.0-rc7-andres-00112-g2710a2b-dirty; KDE/4.8.4; x86_64; ; ) Cc: Shiran Kleiderman References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209270859.09943.andres@2ndquadrant.com> X-Provags-ID: V02:K0:qiDD1Dkx+c+5NiHUAuSE4h4rGnOF2AJrwPMOgLF/gtI 6Fy77yYQRhp8oBd1ylV6GljgTu5RwaDoGVGZIBqJ4bnHOJWA9k IF8lsAEJvPrRleYd6uu4rD2LxqdPX9V4ppTPHyTIFMzHPuPxh8 ZgZO1hH11eDLOVYQ+c3wlFKAhedECxDfCnbbHf8svtQzA1sMTK x7FbIXavfHHzwYvNHccMUtDTm6eHdcc6vhnPZp+d3uCudqqPGR 5foOLc4aGJ5+JqJ5M2MT0k0SG2dbRJWgWQtuKr/6ARjxX/jXL0 B7mJ0BCXMCdKCbccw3hXZI7v3dgL/+ONlM2Wyp0NelQHbdnurC CuzktSJlACsLI/rHJqG6xOGn1FHvIZOn2BR1mHaaT66HF/T8XR Idxz+11Zr6fXA== X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/869 X-Sequence-Number: 190885 On Monday, September 24, 2012 08:45:06 AM Shiran Kleiderman wrote: > Hi, > I'm using and Amazon ec2 instance with the following spec and the > application that I'm running uses a postgres DB 9.1. > The app has 3 main cron jobs. > > *Ubuntu 12, High-Memory Extra Large Instance > 17.1 GB of memory > 6.5 EC2 Compute Units (2 virtual cores with 3.25 EC2 Compute Units each) > 420 GB of instance storage > 64-bit platform* > > I've changed the main default values under file *postgresql.conf* to: > shared_buffers = 4GB > work_mem = 16MB > wal_buffers = 16MB > checkpoint_segments = 32 > effective_cache_size = 8GB > > When I run the app, after an hour or two, free -m looks like below ans the > crons can't run due to memory loss or similar (i'm new to postgres and db > admin). > Thanks! > > free -m, errors: > > total used free shared buffers cached > Mem: 17079 13742 3337 0 64 11882 > -/+ buffers/cache: 1796 15283 > Swap: 511 0 511 > > total used *free* shared buffers cached > Mem: 17079 16833 *245 *0 42 14583 > -/+ buffers/cache: 2207 14871 > Swap: 511 0 511 > > **free above stays low even when nothing is running. > > **errors: > *DBI connect('database=---;host=localhost','postgres',...) failed: could > not fork new process for connection: Cannot allocate memory* > could not fork new process for connection: Cannot allocate memory > > and > execute failed: ERROR: out of memory > DETAIL: Failed on request of size 968. [for Statement " > SELECT DISTINCT.... could you show cat /proc/meminfo? Greetings, Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services