Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XLySW-0000hr-5j for pgsql-admin@arkaria.postgresql.org; Mon, 25 Aug 2014 17:53:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XLySV-000291-LK for pgsql-admin@arkaria.postgresql.org; Mon, 25 Aug 2014 17:53:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XLyST-00025t-Ov for pgsql-admin@postgresql.org; Mon, 25 Aug 2014 17:53:33 +0000 Received: from nm3-vm1.bullet.mail.ne1.yahoo.com ([98.138.91.53]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XLySP-0002Ua-Dk for pgsql-admin@postgresql.org; Mon, 25 Aug 2014 17:53:31 +0000 Received: from [98.138.100.117] by nm3.bullet.mail.ne1.yahoo.com with NNFMP; 25 Aug 2014 17:53:28 -0000 Received: from [98.138.87.3] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 25 Aug 2014 17:53:27 -0000 Received: from [127.0.0.1] by omp1003.mail.ne1.yahoo.com with NNFMP; 25 Aug 2014 17:53:27 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 945189.83128.bm@omp1003.mail.ne1.yahoo.com Received: (qmail 39535 invoked by uid 60001); 25 Aug 2014 17:53:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1408989207; bh=7rHCcLMgrA9FHOwm/Dj3T5F/gphe2NLlCXEomqg7Oas=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=mDddB6lFzDcRwqleahtOycW5YBAJ49Tna9ZBn8xMykZVWGVEySQlJU1RCrji/do3/VnzQNMv0nk8GtqJUhjUgTGMMSAdlbddDIa+Q6Rh7AIhxkrzzFt8nIDTDTLlslDOl+6ehoPS214iX+ZAuFffuznHtZwwCBsTBa3p7Gkogxo= X-YMail-OSG: DitFx4EVM1kjNOroO40iqsW9F0wdhg0fi3F5T0MJagYFbeS 7VwOqkj5MmwZh4NmGYNZMxzMw9TUHf8K1VUOK8RUXa8jJVzLvI4itx7fIgF_ tptptNbxH1m3IDTkwh4MCvj8RdBjsTUkYqk44DEfeT20n3.lEErV3N3qnSZq nO_4FUq8Sz1wdaquFL8sq9xn7gPRbGDy4wsY.sMJokrpnezn7ti.VeqMbUyT aasG3XC539eUl1S7TpSgDyDHVr_YjBunYRvJ9kT_ayngZfIBHkZY2zymlEgE G5GDFQd5HXmQqIcxwDa1p32tD_K6kZK0RhLIVwQMz7HLyKeR7rr5y6IyISf. yj1ewFbRo4IfP1avZmwkhfF64o5YMYtZM_Ypsb81IvBH.qevBpEQpeGf5LKC 0akDfYerloexuOpPVEkEKzfFtUcRfcF6Nxf4ELlv8VduTgKJyO5LB4wV65SD H0eA2FJRzBWvapWFVMdbbm5DF.MEbtQ9fbGSDusUPHIkTkCpMKOYO8TQqruE hTJxKHHhUavv5XFp2qyH7QPXbObK04_.YhTRtDG1heK2NEtCEn5ig9ssaRuC 0o0oP7HC6jgwHuz.6bQ-- Received: from [24.178.25.147] by web122302.mail.ne1.yahoo.com via HTTP; Mon, 25 Aug 2014 10:53:27 PDT X-Rocket-MIMEInfo: 002.001, RGhydXYgU2h1a2xhIDxkaHJ1dnNodWtsYTgyQGdtYWlsLmNvbT4gd3JvdGU6Cj4gS2V2aW4gR3JpdHRuZXIgPGtncml0dG5AeW1haWwuY29tPiB3cm90ZToKPj4gRGhydXYgU2h1a2xhIDxkaHJ1dnNodWtsYTgyQGdtYWlsLmNvbT4gd3JvdGU6Cgo.Pj4gT3RoZXIgaW5mb3JtYXRpb25hbCBkZXRhaWxzIGFib3V0IGNvbmZpZ3VyYXRpb25zIGFyZToKPj4.IHNoYXJlZF9idWZmZXJzID0gODBHQgo.Pj4gdGVtcF9idWZmZXJzID0gMkdCCj4.PiB3b3JrX21lbSA9IDJHQgo.Pj4gbWFpbnRlbmFuY2Vfd29ya19tZW0BMAEBAQE- X-Mailer: YahooMailWebService/0.8.201.700 References: <15C963C4-539B-4A88-9C21-54C3221FD1D7@gmail.com> <1408981867.41595.YahooMailNeo@web122303.mail.ne1.yahoo.com> Message-ID: <1408989207.36764.YahooMailNeo@web122302.mail.ne1.yahoo.com> Date: Mon, 25 Aug 2014 10:53:27 -0700 From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: Problems with PG 9.3 To: Dhruv Shukla Cc: Albe Laurenz , "jayknowsunix@gmail.com" , "pgsql-admin@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Dhruv Shukla wrote: > Kevin Grittner wrote: >> Dhruv Shukla wrote: >>> Other informational details about configurations are: >>> shared_buffers =3D 80GB >>> temp_buffers =3D 2GB >>> work_mem =3D 2GB >>> maintenance_work_mem =3D 16GB >> How much RAM is on the machine (or VM)? > Currently we have a max connection setting for 1000 connections. The temp_buffers setting is a limit *per connection*, and once RAM for a temporary table is allocated to a connection it is never released; so even when all connections are idle they could be setting aside 2TG of RAM for possible use for caching temporary tables. The work_mem setting is an attempt to limit RAM per node of an executing query; one connection can create many allocations of the size set for work_mem.=A0 Since not all queries have nodes that require such allocations, and not all connections are necessarily active at the same time, a general rule of thumb is to allow for one work_mem allocation per connection allowed by max_connections. So these settings can easily result in another 2TB of allocations, beyond the temp_buffers mentioned above. A high shared_buffers setting can result in "write gluts" at the OS level when a high percentage of that memory becomes dirty and is dumped to the OS in a short time.=A0 This can result in the OS appearing to "lock up" for as long as it takes it to flush all of the dirty data to disk.=A0 I don't know what your system is capable of, but most database servers I've seen fall between 20MB/second and 200MB/second.=A0 That would correspond to apparent stalls lasting between 6.8 minutes and 1.1 hours.=A0 By tweaking the bgwriter settings and the OS dirty settings you can drastically reduce this, but I don't think you've indicated having done that, so 80GB can be expected to cause apparent lockups of those durations. A high shared_buffers setting makes you more vulnerable to long stalls because of transparent huge page operations of the OS. > And RAM on server is 384GB RAM. And overcommitting RAM by a factor of more than 10x is not going to be pretty in any event. If I could not reduce max_connections, I would set work_mem to no more than 100MB and temp_buffers to no more than 50MB.=A0 I would drop maintenance_work_mem to 2GB.=A0 I would probably drastically reduce shared_buffers and would most certainly make autovacuum and bgwriter more aggressive than the default. If you make those changes and still see a problem, only then is it worth looking at other possible causes. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin