From mpuncia@census.gov.ph Fri Jun 18 13:23:42 2004 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8A186D1B1B7 for ; Fri, 18 Jun 2004 10:23:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97178-05 for ; Fri, 18 Jun 2004 13:23:43 +0000 (GMT) Received: from mail.census.gov.ph (gateway.census.gov.ph [203.172.28.97]) by svr1.postgresql.org (Postfix) with ESMTP id CA1F2D1B188 for ; Fri, 18 Jun 2004 10:22:48 -0300 (ADT) Received: from notnot (gateway.census.gov.ph [203.172.28.97]) by mail.census.gov.ph (8.12.8/8.12.8) with ESMTP id i5IDKLrA010944 for ; Fri, 18 Jun 2004 21:20:50 +0800 Message-Id: <200406181320.i5IDKLrA010944@mail.census.gov.ph> From: "Michael Ryan S. Puncia" To: Subject: memory allocation Date: Fri, 18 Jun 2004 21:34:40 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0000_01C4557C.16F70690" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcRVOQD5fTV4ABZhTWOYRYgUurM2Mw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2096 X-MailScanner: Found to be clean by NSO mail server. X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200406/184 X-Sequence-Number: 7242 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C4557C.16F70690 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi everyone . How much memory should I give to the kernel and postgresql I have 1G of memory and 120G of HD Shared Buffers = ? Vacuum Mem = ? SHMAX = ? Sorry I have so many question .I am a newbie :-( I have 30G of data At least 30 simultaneus users But I will use it only for query with lot of sorting thanks ------=_NextPart_000_0000_01C4557C.16F70690 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi everyone .

 

How much memory should I give to the kernel and postgres= ql

 

I have 1G of memory and 120G of HD

 

Shared Buffers =3D ?

Vacuum Mem =3D ?

SHMAX =3D ?

 

Sorry I have so many question .I am a newbie L

 

I have 30G of data

At least 30 simultaneus users

But I will use it only for query with lot of sorting

 

thanks

------=_NextPart_000_0000_01C4557C.16F70690-- From devrim@gunduz.org Fri Jun 18 13:39:43 2004 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CCA15D1B37D for ; Fri, 18 Jun 2004 10:39:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21279-01 for ; Fri, 18 Jun 2004 13:39:42 +0000 (GMT) Received: from emo.org.tr (emo.org.tr [195.142.105.9]) by svr1.postgresql.org (Postfix) with ESMTP id 6B8C2D1B188 for ; Fri, 18 Jun 2004 10:39:36 -0300 (ADT) Received: by emo.org.tr (Postfix, from userid 41643) id 33CF12FECE; Fri, 18 Jun 2004 16:39:33 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by emo.org.tr (Postfix) with ESMTP id 2A812111ED6 for ; Fri, 18 Jun 2004 16:39:33 +0300 (EEST) Date: Fri, 18 Jun 2004 16:39:30 +0300 (EEST) From: Devrim GUNDUZ X-X-Sender: devrim2@emo.org.tr Reply-To: pgsql-performance@PostgreSQL.org To: pgsql-performance@PostgreSQL.org Subject: Re: memory allocation In-Reply-To: <200406181320.i5IDKLrA010944@mail.census.gov.ph> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200406/186 X-Sequence-Number: 7244 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, On Fri, 18 Jun 2004, Michael Ryan S. Puncia wrote: > How much memory should I give to the kernel and postgresql > > I have 1G of memory and 120G of HD > > Shared Buffers = ? > > Vacuum Mem = ? Maybe you should read http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.sxw OR http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html > SHMAX = ? SHMMAX is not that relevant with PostgreSQL, it's rather relevant with your operating system. Regards, - -- Devrim GUNDUZ devrim~gunduz.org devrim.gunduz~linux.org.tr http://www.tdmsoft.com http://www.gunduz.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFA0vCUtl86P3SPfQ4RAvITAJ48FV24aBN+nc2+lkRwXc79HlHV6QCfSvRA YuGjn8hs1jvOJ2Ah9oamIJQ= =96+i -----END PGP SIGNATURE----- From dev@archonet.com Fri Jun 18 13:58:18 2004 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CBC28D1B755 for ; Fri, 18 Jun 2004 10:58:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31833-06 for ; Fri, 18 Jun 2004 13:58:18 +0000 (GMT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id B39C2D1B750 for ; Fri, 18 Jun 2004 10:58:14 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1BbJsn-000C5R-0U; Fri, 18 Jun 2004 14:58:18 +0100 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id E78BD16DD7; Fri, 18 Jun 2004 14:58:16 +0100 (BST) Message-ID: <40D2F4F8.20600@archonet.com> Date: Fri, 18 Jun 2004 14:58:16 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Michael Ryan S. Puncia" Cc: pgsql-performance@postgresql.org Subject: Re: memory allocation References: <200406181320.i5IDKLrA010944@mail.census.gov.ph> In-Reply-To: <200406181320.i5IDKLrA010944@mail.census.gov.ph> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/190 X-Sequence-Number: 7248 Michael Ryan S. Puncia wrote: > Hi everyone . > > > > How much memory should I give to the kernel and postgresql > > I have 1G of memory and 120G of HD Devrim's pointed you to a guide to the configuration file. There's also an introduction to performance tuning on the same site. An important thing to remember is that the sort_mem is the amount of memory available *per sort* and some queries can use several sorts. -- Richard Huxton Archonet Ltd From ryan.hansen@brightbuilders.com Wed Nov 26 22:10:09 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0F3E365018A for ; Wed, 26 Nov 2008 18:10:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 74367-01 for ; Wed, 26 Nov 2008 18:10:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from bb-email.net (bb-email.net [128.121.78.132]) by mail.postgresql.org (Postfix) with ESMTP id 167D464FEBB for ; Wed, 26 Nov 2008 18:09:59 -0400 (AST) Received: from bb001077 (hammertaprg.hammertap.com [67.50.128.40]) (authenticated bits=0) by bb-email.net (8.13.6.20060614/8.13.6) with ESMTP id mAQM9w45027124 for ; Wed, 26 Nov 2008 15:09:58 -0700 (MST) From: "Ryan Hansen" To: Subject: Memory Allocation Date: Wed, 26 Nov 2008 15:09:55 -0700 Message-ID: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0112_01C94FD9.0A9DC8A0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AclQE7aF+6Fp0CtJTcOBvOAXcEpAHg== Content-Language: en-us X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (bb-email.net [128.121.78.132]); Wed, 26 Nov 2008 15:09:58 -0700 (MST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.212 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, MSGID_MULTIPLE_AT=1.211 X-Spam-Level: * X-Archive-Number: 200811/271 X-Sequence-Number: 32002 This is a multipart message in MIME format. ------=_NextPart_000_0112_01C94FD9.0A9DC8A0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hey all, This may be more of a Linux question than a PG question, but I'm wondering if any of you have successfully allocated more than 8 GB of memory to PG before. I have a fairly robust server running Ubuntu Hardy Heron, 24 GB of memory, and I've tried to commit half the memory to PG's shared buffer, but it seems to fail. I'm setting the kernel shared memory accordingly using sysctl, which seems to work fine, but when I set the shared buffer in PG and restart the service, it fails if it's above about 8 GB. I actually have it currently set at 6 GB. I don't have the exact failure message handy, but I can certainly get it if that helps. Mostly I'm just looking to know if there's any general reason why it would fail, some inherent kernel or db limitation that I'm unaware of. If it matters, this DB is going to be hosting and processing hundreds of GB and eventually TB of data, it's a heavy read-write system, not transactional processing, just a lot of data file parsing (python/bash) and bulk loading. Obviously the disks get hit pretty hard already, so I want to make the most of the large amount of available memory wherever possible. So I'm trying to tune in that direction. Any info is appreciated. Thanks! ------=_NextPart_000_0112_01C94FD9.0A9DC8A0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hey all,

 

This may be more of a Linux question than a PG = question, but I’m wondering if any of you have successfully allocated more than = 8 GB of memory to PG before.

 

I have a fairly robust server running Ubuntu Hardy = Heron, 24 GB of memory, and I’ve tried to commit half the memory to = PG’s shared buffer, but it seems to fail.  I’m setting the kernel = shared memory accordingly using sysctl, which seems to work fine, but when I = set the shared buffer in PG and restart the service, it fails if it’s = above about 8 GB.  I actually have it currently set at 6 GB.

 

I don’t have the exact failure message handy, = but I can certainly get it if that helps.  Mostly I’m just looking = to know if there’s any general reason why it would fail, some inherent = kernel or db limitation that I’m unaware of. 

 

If it matters, this DB is going to be hosting and = processing hundreds of GB and eventually TB of data, it’s a heavy read-write = system, not transactional processing, just a lot of data file parsing = (python/bash) and bulk loading.  Obviously the disks get hit pretty hard already, so = I want to make the most of the large amount of available memory wherever = possible.  So I’m trying to tune in that direction.

 

Any info is appreciated.

 

Thanks!

------=_NextPart_000_0112_01C94FD9.0A9DC8A0-- From ahodgson@simkin.ca Wed Nov 26 22:18:28 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4A5EF6504EE for ; Wed, 26 Nov 2008 18:18:28 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75927-08-2 for ; Wed, 26 Nov 2008 18:18:24 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from skynet.simkin.ca (skynet.simkin.ca [72.51.27.117]) by mail.postgresql.org (Postfix) with ESMTP id 571E46503C8 for ; Wed, 26 Nov 2008 18:18:23 -0400 (AST) Received: from charon.medialogik.com (S0106000c6eb33e73.vc.shawcable.net [70.79.155.38]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by skynet.simkin.ca (Postfix) with ESMTP id 6B8F84A64 for ; Wed, 26 Nov 2008 14:18:16 -0800 (PST) From: Alan Hodgson Organization: Simkin Network Consulting To: pgsql-performance@postgresql.org Subject: Re: Memory Allocation Date: Wed, 26 Nov 2008 14:18:12 -0800 User-Agent: KMail/1.9.10 References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> In-Reply-To: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811261418.12286@hal.medialogik.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/272 X-Sequence-Number: 32003 On Wednesday 26 November 2008, "Ryan Hansen" wrote: > This may be more of a Linux question than a PG question, but I'm > wondering if any of you have successfully allocated more than 8 GB of > memory to PG before. > CentOS 5, 24GB shared_buffers on one server here. No problems. -- Alan From morenopg@mochima.com Wed Nov 26 22:57:55 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D870A6501F8 for ; Wed, 26 Nov 2008 18:57:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84379-09 for ; Wed, 26 Nov 2008 18:57:53 -0400 (AST) X-Greylist: delayed 00:10:38.140399 by SQLgrey-1.7.6 Received: from net-domino.com (net-domino.com [74.208.97.86]) by mail.postgresql.org (Postfix) with ESMTP id 12B396501DC for ; Wed, 26 Nov 2008 18:57:52 -0400 (AST) Received: from [127.0.0.1] (u15278506.onlinehome-server.com [74.208.97.86]) by net-domino.com (8.14.1/8.14.1) with ESMTP id mAQMl5BK001174; Wed, 26 Nov 2008 18:47:06 -0400 Message-ID: <492DD1EA.8000504@mochima.com> Date: Wed, 26 Nov 2008 17:47:06 -0500 From: Carlos Moreno User-Agent: Thunderbird 2.0.0.18 (X11/20081125) MIME-Version: 1.0 To: Ryan Hansen CC: pgsql-performance@postgresql.org Subject: Re: Memory Allocation References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> In-Reply-To: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Added-Header: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/274 X-Sequence-Number: 32005 Ryan Hansen wrote: > > Hey all, > > This may be more of a Linux question than a PG question, but I’m > wondering if any of you have successfully allocated more than 8 GB of > memory to PG before. > > I have a fairly robust server running Ubuntu Hardy Heron, 24 GB of > memory, and I’ve tried to commit half the memory to PG’s shared > buffer, but it seems to fail. > Though not sure why this is happening or whether it is normal, I would suggest that such setting is maybe too high. From the Annotated postgresql.conf document at http://www.powerpostgresql.com/Downloads/annotated_conf_80.html, the suggested range is 8 to 400MB. They specifically say that it should never be set to more than 1/3 of the available memory, which in your case is precisely the 8GB figure (I guess that's just a coincidence --- I doubt that the server would be written so that it fails to start if shared_buffers is more than 1/3 of available RAM) Another important parameter that you don't mention is the effective_cache_size, which that same document suggests should be about 2/3 of available memory. (this tells the planner the amount of data that it can "probabilistically" expect to reside in memory due to caching, and as such, the planner is likely to produce more accurate estimates and thus better query optimizations). Maybe you could set shared_buffers to, say, 1 or 2GB (that's already beyond the recommended figure, but given that you have 24GB, it may not hurt), and then effective_cache_size to 16GB or so? HTH, Carlos -- From tgl@sss.pgh.pa.us Wed Nov 26 22:58:38 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id AD1B265014C for ; Wed, 26 Nov 2008 18:58:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85257-01 for ; Wed, 26 Nov 2008 18:58:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 0E5D16504F2 for ; Wed, 26 Nov 2008 18:58:35 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id mAQMwXCq026200; Wed, 26 Nov 2008 17:58:33 -0500 (EST) To: "Ryan Hansen" cc: pgsql-performance@postgresql.org Subject: Re: Memory Allocation In-reply-to: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> Comments: In-reply-to "Ryan Hansen" message dated "Wed, 26 Nov 2008 15:09:55 -0700" Date: Wed, 26 Nov 2008 17:58:33 -0500 Message-ID: <26199.1227740313@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/275 X-Sequence-Number: 32006 "Ryan Hansen" writes: > I have a fairly robust server running Ubuntu Hardy Heron, 24 GB of memory, > and I've tried to commit half the memory to PG's shared buffer, but it seems > to fail. I'm setting the kernel shared memory accordingly using sysctl, > which seems to work fine, but when I set the shared buffer in PG and restart > the service, it fails if it's above about 8 GB. Fails how? And what PG version is that? FWIW, while there are various schools of thought on how large to make shared_buffers, pretty much everybody agrees that half of physical RAM is not the sweet spot. What you're likely to get is maximal inefficiency with every active disk page cached twice --- once in kernel space and once in shared_buffers. regards, tom lane From scott@richrelevance.com Wed Nov 26 23:00:39 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id BECBC6501DC for ; Wed, 26 Nov 2008 19:00:39 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85382-04 for ; Wed, 26 Nov 2008 19:00:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EXHUB018-3.exch018.msoutlookonline.net (exhub018-3.exch018.msoutlookonline.net [64.78.17.18]) by mail.postgresql.org (Postfix) with ESMTP id EF62965014C for ; Wed, 26 Nov 2008 19:00:30 -0400 (AST) Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-3.exch018.msoutlookonline.net ([64.78.17.18]) with mapi; Wed, 26 Nov 2008 15:00:29 -0800 From: Scott Carey To: Ryan Hansen , "pgsql-performance@postgresql.org" Date: Wed, 26 Nov 2008 15:00:26 -0800 Subject: Re: Memory Allocation Thread-Topic: [PERFORM] Memory Allocation Thread-Index: AclQE7aF+6Fp0CtJTcOBvOAXcEpAHgAA03mQ Message-ID: References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> In-Reply-To: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_BDFBB77C9E07BE4A984DAAE981D19F961ACA1F1ADCEXVMBX0181exc_" MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200811/276 X-Sequence-Number: 32007 --_000_BDFBB77C9E07BE4A984DAAE981D19F961ACA1F1ADCEXVMBX0181exc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Tuning for bulk loading: Make sure the Linux kernel paramters in /proc/sys/vm related to the page ca= che are set well. Set swappiness to 0 or 1. Make sure you understand and configure /proc/sys/vm/dirty_background_ratio and /proc/sys/vm/dirty_ratio well. With enough RAM the default on some kernel versions is way, way off (40% of= RAM with dirty pages! yuck). http://www.westnet.com/~gsmith/content/linux-pdflush.htm If postgres is doing a lot of caching for you you probably want dirty_ratio= at 10% or less, and you'll want the OS to start flushing to disk sooner ra= ther than later. A dirty_background_ratio of 3% with 24GB of RAM is 720MB= -- a pretty big buffer. I would not personally want this buffer to be lar= ger than 5 seconds of max write speed of the disk I/O. You'll need to tune your background writer to be aggressive enough to actua= lly write data fast enough so that checkpoints don't suck, and tune your ch= eckpoint size and settings as well. Turn on checkpoint logging on the data= base and run tests while looking at the output of those. Ideally, most of = your batch writes have made it to the OS before the checkpoint, and the OS = has actually started moving most of it to disk. If your settings are wrong= , you'll have the data buffered twice, and most or nearly all of it will b= e in memory when the checkpoint happens, and the checkpoint will take a LON= G time. The default Linux settings + default postgres settings + large sha= red_buffers will almost guarantee this situation for bulk loads. Both have= to be configured with complementary settings. If you have a large postgre= s buffer, the OS buffer should be small and write more aggressively. If yo= u have a small postgres buffer, the OS can be more lazy and cache much more= . From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owne= r@postgresql.org] On Behalf Of Ryan Hansen Sent: Wednesday, November 26, 2008 2:10 PM To: pgsql-performance@postgresql.org Subject: [PERFORM] Memory Allocation Hey all, This may be more of a Linux question than a PG question, but I'm wondering = if any of you have successfully allocated more than 8 GB of memory to PG be= fore. I have a fairly robust server running Ubuntu Hardy Heron, 24 GB of memory, = and I've tried to commit half the memory to PG's shared buffer, but it seem= s to fail. I'm setting the kernel shared memory accordingly using sysctl, = which seems to work fine, but when I set the shared buffer in PG and restar= t the service, it fails if it's above about 8 GB. I actually have it curre= ntly set at 6 GB. I don't have the exact failure message handy, but I can certainly get it if= that helps. Mostly I'm just looking to know if there's any general reason= why it would fail, some inherent kernel or db limitation that I'm unaware = of. If it matters, this DB is going to be hosting and processing hundreds of GB= and eventually TB of data, it's a heavy read-write system, not transaction= al processing, just a lot of data file parsing (python/bash) and bulk loadi= ng. Obviously the disks get hit pretty hard already, so I want to make the= most of the large amount of available memory wherever possible. So I'm tr= ying to tune in that direction. Any info is appreciated. Thanks! --_000_BDFBB77C9E07BE4A984DAAE981D19F961ACA1F1ADCEXVMBX0181exc_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Tuning for bulk loading:=

 =

Make sure the Linux kern= el paramters in /proc/sys/vm related to the page cache are set well.

Set swappiness to 0 or 1= .

Make sure you understand= and configure /proc/sys/vm/dirty_background_ratio

and /proc/sys/vm/dirty_r= atio well. 

With enough RAM the defa= ult on some kernel versions is way, way off (40% of RAM with dirty pages!  yu= ck).

http://ww= w.westnet.com/~gsmith/content/linux-pdflush.htm

If postgres is doing a l= ot of caching for you you probably want dirty_ratio at 10% or less, and you'll wa= nt the OS to start flushing to disk sooner rather than later.  A dirty_background_ratio of 3% with 24GB of RAM  is 720MB -- a pretty bi= g buffer.  I would not personally want this buffer to be larger than 5 s= econds of max write speed of the disk I/O.

 =

You'll need to tune your background writer to be aggressive enough to actually write data fast enoug= h so that checkpoints don't suck, and tune your checkpoint size and settings as well.  Turn on checkpoint logging on the database and run tests while looking at the output of those.  Ideally, most of your batch writes ha= ve made it to the OS before the checkpoint, and the OS has actually started mo= ving most of it to disk.  If your settings are wrong,  you'll have the data buffered twice, and most or nearly all of it will be in memory when th= e checkpoint happens, and the checkpoint will take a LONG time.  The def= ault Linux settings + default postgres settings + large shared_buffers will almo= st guarantee this situation for bulk loads.  Both have to be configured w= ith complementary settings.  If you have a large postgres buffer, the OS buffer should be small and write more aggressively.  If you have a sma= ll postgres buffer, the OS can be more lazy and cache much more.

 =

 =

From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@post= gresql.org] On Behalf Of Ryan Hansen
Sent: Wednesday, November 26, 2008 2:10 PM
To: pgsql-performance@postgresql.org
Subject: [PERFORM] Memory Allocation

 

Hey all,

 

This may be more of a Linux question than a PG questio= n, but I’m wondering if any of you have successfully allocated more than 8 G= B of memory to PG before.

 

I have a fairly robust server running Ubuntu Hardy Her= on, 24 GB of memory, and I’ve tried to commit half the memory to PG’s shared buffer, but it seems to fail.  I’m setting the kernel sha= red memory accordingly using sysctl, which seems to work fine, but when I set t= he shared buffer in PG and restart the service, it fails if it’s above a= bout 8 GB.  I actually have it currently set at 6 GB.

 

I don’t have the exact failure message handy, bu= t I can certainly get it if that helps.  Mostly I’m just looking to = know if there’s any general reason why it would fail, some inherent kernel= or db limitation that I’m unaware of. 

 

If it matters, this DB is going to be hosting and proc= essing hundreds of GB and eventually TB of data, it’s a heavy read-write sys= tem, not transactional processing, just a lot of data file parsing (python/bash)= and bulk loading.  Obviously the disks get hit pretty hard already, so I w= ant to make the most of the large amount of available memory wherever possible.  So I’m trying to tune in that direction.

 

Any info is appreciated.

 

Thanks!

--_000_BDFBB77C9E07BE4A984DAAE981D19F961ACA1F1ADCEXVMBX0181exc_-- From Kevin.Grittner@wicourts.gov Wed Nov 26 23:09:27 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 22E496501DC for ; Wed, 26 Nov 2008 19:09:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 86967-06 for ; Wed, 26 Nov 2008 19:09:24 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6FC9E65014C for ; Wed, 26 Nov 2008 19:09:24 -0400 (AST) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Wed, 26 Nov 2008 17:09:23 -0600 Message-Id: <492D82BB.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Wed, 26 Nov 2008 17:09:15 -0600 From: "Kevin Grittner" To: "Ryan Hansen" , "pgsql-performance@postgresql.org" , "Scott Carey" Subject: Re: Memory Allocation References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> In-Reply-To: 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-Archive-Number: 200811/277 X-Sequence-Number: 32008 >>> Scott Carey wrote: > Set swappiness to 0 or 1. We recently converted all 72 remote county databases from 8.2.5 to 8.3.4. In preparation we ran a test conversion of a large county over and over with different settings to see what got us the best performance. Setting swappiness below the default degraded performance for us in those tests for identical data, same hardware, no other changes. Our best guess is that code which really wasn't getting called got swapped out leaving more space in the OS cache, but that's just a guess. Of course, I'm sure people would not be recommending it if they hadn't done their own benchmarks to confirm that this setting actually improved things in their environments, so the lesson here is to test for your environment when possible. -Kevin From scott@richrelevance.com Wed Nov 26 23:52:51 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B4685650295 for ; Wed, 26 Nov 2008 19:52:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 95751-05 for ; Wed, 26 Nov 2008 19:52:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EXHUB018-2.exch018.msoutlookonline.net (exhub018-2.exch018.msoutlookonline.net [64.78.17.17]) by mail.postgresql.org (Postfix) with ESMTP id CC3EB65018A for ; Wed, 26 Nov 2008 19:52:48 -0400 (AST) Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-2.exch018.msoutlookonline.net ([64.78.17.17]) with mapi; Wed, 26 Nov 2008 15:52:47 -0800 From: Scott Carey To: Kevin Grittner , Ryan Hansen , "pgsql-performance@postgresql.org" Date: Wed, 26 Nov 2008 15:52:44 -0800 Subject: Re: Memory Allocation Thread-Topic: [PERFORM] Memory Allocation Thread-Index: AclQHAZ+SPKLFg3cTUiVl0PGGdOargAAWcGQ Message-ID: References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> <492D82BB.EE98.0025.0@wicourts.gov> In-Reply-To: <492D82BB.EE98.0025.0@wicourts.gov> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/278 X-Sequence-Number: 32009 Swappiness optimization is going to vary. Definitely test on your own. For a bulk load database, with large page cache, swappines =3D 60 (default)= is _GUARANTEED_ to force the OS to swap out some of Postgres while in heav= y use. This is heavily dependent on the page cache size, work_mem size, an= d concurrency. I've had significantly increased performance setting this value low (1000x = ! -- if your DB starts swapping postgres, you're performance-DEAD). The de= fault has the OS targeting close to 60% of the memory for page cache. On a= 32GB server, with 7GB postgres buffer cache, several concurrent queries re= ading GB's of data and using 500MB + work_mem (huge aggregates), the defaul= t swappiness will choose to page out postgres with about 19GB of disk page = cache left to evict, with disastrous results. And that is a read-only test= . Tests with writes can trigger it earlier if combined with bad dirty_buff= ers settings. The root of the problem is that the Linux paging algorithm estimates that I= /O for file read access is as costly as I/O for paging. A reasonable assum= ption for a desktop, a ridiculously false assumption for a large database w= ith high capacity DB file I/O and a much lower capability swap file. Not o= nly that -- page in is almost always near pure random reads, but DB I/O is = often sequential. So losing 100M of cached db file takes a lot less time t= o scan back in than 100MB of the application. If you do have enough other applications that are idle that take up RAM tha= t should be pushed out to disk from time to time (perhaps your programs tha= t are doing the bulk loading?) a higher value is useful. Although it is no= t exact, think of the swappiness value as the percentage of RAM that the OS= would prefer page cache to applications (very roughly). The more RAM you have and the larger your postgres memory usage, the lower = the swappiness value should be. 60% of 24GB is ~14.5GB, If you have that m= uch stuff that is in RAM that should be paged out to save space, try it. I currently use a value of 1, on a 32GB machine, and about 600MB of 'stuff'= gets paged out normally, 1400MB under heavy load. This is a dedicated mac= hine. Higher values page out more stuff that increases the cache size and = helps performance a little, but under the heavy load, it hits the paging wa= ll and falls over. The small improvement in performance when the system is= not completely stressed is not worth risking hitting the wall for me. ***For a bulk load database, one is optimizing for _writes_ and extra page = cache doesn't help writes like it does reads.*** When I use a machine with misc. other lower priority apps and less RAM, I h= ave found larger values to be helpful. If your DB is configured with a low shared_buffers and small work_mem, you = probably want the OS to use that much memory for disk pages, and again a hi= gher swappiness may be more optimal. Like all of these settings, tune to your application and test. Many of the= se settings are things that go hand in hand with others, but alone don't ma= ke as much sense. Tuning Postgres to do most of the caching and making the= OS get out of the way is far different than tuning the OS to do as much ca= ching work as possible and minimizing postgres. Which of those two strateg= ies is best is highly application dependent, somewhat O/S dependent, and al= so hardware dependent. -----Original Message----- From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov] Sent: Wednesday, November 26, 2008 3:09 PM To: Ryan Hansen; pgsql-performance@postgresql.org; Scott Carey Subject: Re: [PERFORM] Memory Allocation >>> Scott Carey wrote: > Set swappiness to 0 or 1. We recently converted all 72 remote county databases from 8.2.5 to 8.3.4. In preparation we ran a test conversion of a large county over and over with different settings to see what got us the best performance. Setting swappiness below the default degraded performance for us in those tests for identical data, same hardware, no other changes. Our best guess is that code which really wasn't getting called got swapped out leaving more space in the OS cache, but that's just a guess. Of course, I'm sure people would not be recommending it if they hadn't done their own benchmarks to confirm that this setting actually improved things in their environments, so the lesson here is to test for your environment when possible. -Kevin From Kevin.Grittner@wicourts.gov Fri Nov 28 22:28:53 2008 Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 518D665021C for ; Fri, 28 Nov 2008 18:28:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14535-06 for ; Fri, 28 Nov 2008 18:28:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 3DE6D64FFC0 for ; Fri, 28 Nov 2008 18:28:50 -0400 (AST) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Fri, 28 Nov 2008 16:28:48 -0600 Message-Id: <49301C3A.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Fri, 28 Nov 2008 16:28:42 -0600 From: "Kevin Grittner" To: "Ryan Hansen" , "pgsql-performance@postgresql.org" , "Scott Carey" Subject: Re: Memory Allocation References: <011101c95013$b6fca0a0$24f5e1e0$@hansen@brightbuilders.com> <492D82BB.EE98.0025.0@wicourts.gov> In-Reply-To: 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-Archive-Number: 200811/300 X-Sequence-Number: 32031 I'm hoping that through compare/contrast we might help someone start closer to their own best values.... >>> Scott Carey wrote: > Tests with writes can trigger it earlier if combined with bad dirty_buffers > settings. We've never, ever modified dirty_buffers settings from defaults. > The root of the problem is that the Linux paging algorithm estimates that > I/O for file read access is as costly as I/O for paging. A reasonable > assumption for a desktop, a ridiculously false assumption for a large > database with high capacity DB file I/O and a much lower capability swap > file. Our swap file is not on lower speed drives. > If you do have enough other applications that are idle that take up RAM that > should be pushed out to disk from time to time (perhaps your programs that > are doing the bulk loading?) a higher value is useful. Bulk loading was ssh cat | psql. > The more RAM you have and the larger your postgres memory usage, the lower > the swappiness value should be. I think the test environment had 8 GB RAM with 256 MB in shared_buffers. For the conversion we had high work_mem and maintenance_work_mem settings, and we turned fsync off, along with a few other settings we would never using during production. > I currently use a value of 1, on a 32GB machine, and about 600MB of 'stuff' > gets paged out normally, 1400MB under heavy load. Outside of bulk load, we've rarely seen anything swap, even under load. > ***For a bulk load database, one is optimizing for _writes_ and extra page > cache doesn't help writes like it does reads.*** I'm thinking that it likely helps when indexing tables for which data has recently been loaded. It also might help minimize head movement and/or avoid the initial disk hit for a page which subsequently get hint bits set . > Like all of these settings, tune to your application and test. We sure seem to agree on that. -Kevin From nijamutheenblogs1@gmail.com Tue Oct 17 09:28:45 2017 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e58ok-0006Dw-2A for pgsql-performance@arkaria.postgresql.org; Thu, 19 Oct 2017 11:16:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e58oj-000225-H4 for pgsql-performance@arkaria.postgresql.org; Thu, 19 Oct 2017 11:16:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e4OBA-0003im-DG for pgsql-performance@postgresql.org; Tue, 17 Oct 2017 09:28:52 +0000 Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e4OB6-0007yd-OW for pgsql-performance@postgresql.org; Tue, 17 Oct 2017 09:28:51 +0000 Received: by mail-oi0-x232.google.com with SMTP id h200so1680363oib.4 for ; Tue, 17 Oct 2017 02:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6CdTHXumQfeWfWDIyWOsVELWOz8jPrxxqBU7T6CykYE=; b=l6kxqSWILOYBBy5TyWXfrKMOGLNXgppMbH8zaTJiTn/VBrfybi4UE2eCOG7wwOGfXG o5mu9ZrNtuDPSHasvuJpttY1EhsPnKullL/OyxzwzmLCh2GsRFTCobr0W6sDk33Wed94 eRo9g+CiDmNxE/VcVitfcISth/VyIaKJFpc5RNq4XjFpsAhySPGRDV466tXFshOuRCO4 D3sQhS0OaMYLF08D61NvWfTPqCntWLM+ihG8erSh0DQ7V5+hmY3cEI+rpx9yn6D+6w1H A1zW9bcyjLL/iB/HU0GuEvqY3a7RObLAXZnuFz6rBYBL19bY7PC63y01BGR4191Q7n/n nW6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6CdTHXumQfeWfWDIyWOsVELWOz8jPrxxqBU7T6CykYE=; b=R8Gc1orEx9pUsOwopxiW9UgM9XZRcXHTRuHwe00azzeOT9QC23VXMQfN6angwCqWow 8eNB/PSvDtLrsA7Q8xUIP/8lMd8CBjm8eIVuOLraxLUgdM2ONg8fudjBe1GrtI9TuEEh jSaGS3FH/7itRXbvq0bU/6uzy8nP96yJCaThykjnY/nZfTzJ0pxoOABSosKYV7+YLk/C tvGtb3m5CH9lzsLLCKauaTsGynWsUtzs8jFDrWdzZBLHIBQkQ1iL274HGQ68KBlFZpff OsPm6fJa2gBmtsy5jB9aROIF6O3VSzWYYPYcMoAHVf9cMtCpvBnphWQlnLdwTtcijpSH 1rBQ== X-Gm-Message-State: AMCzsaVvXfpecMxFlQykZkValma+dCn4LMqQ36ItLA4nRVZ67kMPgjxY BqL/J80YFJZHXaThMTk6zLFRFy/sl1EcX2vtsszFNtaV X-Google-Smtp-Source: ABhQp+RIJnYc9ukGg3s8jUFv/LIn+LqsjDsIxZmWSJgdrs0fvH+hEx3E+zdJs6G585tFIVVCavhoUNHGmlUa8aCwJQw= X-Received: by 10.202.79.7 with SMTP id d7mr7089585oib.273.1508232526047; Tue, 17 Oct 2017 02:28:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.0.173 with HTTP; Tue, 17 Oct 2017 02:28:45 -0700 (PDT) From: nijam J Date: Tue, 17 Oct 2017 14:58:45 +0530 Message-ID: Subject: memory allocation To: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary="001a113d720ef43033055bbabfd2" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --001a113d720ef43033055bbabfd2 Content-Type: text/plain; charset="UTF-8" we are using cloud server *this are memory info* free -h total used free shared buffers cached Mem: 15G 15G 197M 194M 121M 14G -/+ buffers/cache: 926M 14G Swap: 15G 32M 15G *this are disk info:* df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 20G 1.7G 17G 10% / devtmpfs 7.9G 0 7.9G 0% /dev tmpfs 7.9G 4.0K 7.9G 1% /dev/shm tmpfs 7.9G 17M 7.9G 1% /run tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/mapper/vgzero-lvhome 99G 189M 94G 1% /home /dev/mapper/vgzero-lvdata 1.2T 75G 1.1T 7% /data /dev/mapper/vgzero-lvbackup 296G 6.2G 274G 3% /backup /dev/mapper/vgzero-lvxlog 197G 61M 187G 1% /pg_xlog /dev/mapper/vgzero-lvarchive 197G 67G 121G 36% /archive i allocated memory as per following list: shared_buffers = 2GB (10-30 %) effective_cache_size =7GB (70-75 %) ---->>(shared_buffers+page cache) for dedicated server only work_mem = 128MB (0.3-1 %) maintenance_work_mem = 512MB (0.5-4 % ) temp_Buffer = 8MB ---->>default is better( setting can be changed within individual sessions) checkpoint_segments = 64 checkpoint_completion_target = 0.9 random_page_cost = 3.5 cpu_tuple_cost = 0.05 wal_buffers = 32MB leave this default 3% of shared buffer is better is it better or do i want to modify any thing our server is getting too slow again and again please give me a suggestion --001a113d720ef43033055bbabfd2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
we are using cloud server=C2=A0

this= are memory info

free -h
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0total=C2=A0 =C2=A0 =C2=A0 = =C2=A0used=C2=A0 =C2=A0 =C2=A0 =C2=A0free=C2=A0 =C2=A0 =C2=A0shared=C2=A0 = =C2=A0 buffers=C2=A0 =C2=A0 =C2=A0cached
Mem:=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A015G=C2=A0 =C2=A0 =C2=A0 =C2=A0 15G=C2=A0 =C2=A0 =C2=A0= =C2=A0197M=C2=A0 =C2=A0 =C2=A0 =C2=A0194M=C2=A0 =C2=A0 =C2=A0 =C2=A0121M= =C2=A0 =C2=A0 =C2=A0 =C2=A0 14G
-/+ buffers/cache:=C2=A0 =C2=A0 = =C2=A0 =C2=A0926M=C2=A0 =C2=A0 =C2=A0 =C2=A0 14G
Swap:=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 15G=C2=A0 =C2=A0 =C2=A0 =C2=A0 32M=C2=A0 =C2=A0 = =C2=A0 =C2=A0 15G

this are disk inf= o:
=C2=A0df -h

Filesystem=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Size=C2=A0 Used Avail Use% Mount= ed on
/dev/vda1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 20G=C2=A0 1.7G=C2=A0 =C2=A017G=C2=A0 10% /
devtmpfs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 7.9G=C2=A0 =C2=A0 =C2=A00=C2=A0 7.9G=C2=A0 =C2=A00% /dev<= /div>
tmpfs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07.9G=C2=A0 4.0K=C2=A0 7.9G=C2=A0 =C2=A01% /d= ev/shm
tmpfs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07.9G=C2=A0 =C2=A017M=C2=A0 7.9G=C2=A0= =C2=A01% /run
tmpfs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07.9G=C2=A0 =C2=A0 =C2=A00=C2= =A0 7.9G=C2=A0 =C2=A00% /sys/fs/cgroup
/dev/mapper/vgzero-lvhome= =C2=A0 =C2=A0 =C2=A0 99G=C2=A0 189M=C2=A0 =C2=A094G=C2=A0 =C2=A01% /home
/dev/mapper/vgzero-lvdata=C2=A0 =C2=A0 =C2=A01.2T=C2=A0 =C2=A075G= =C2=A0 1.1T=C2=A0 =C2=A07% /data
/dev/mapper/vgzero-lvbackup=C2= =A0 =C2=A0296G=C2=A0 6.2G=C2=A0 274G=C2=A0 =C2=A03% /backup
/dev/= mapper/vgzero-lvxlog=C2=A0 =C2=A0 =C2=A0197G=C2=A0 =C2=A061M=C2=A0 187G=C2= =A0 =C2=A01% /pg_xlog
/dev/mapper/vgzero-lvarchive=C2=A0 197G=C2= =A0 =C2=A067G=C2=A0 121G=C2=A0 36% /archive



i allocated= memory as per following list:
shared_buffers =3D 2GB=C2=A0 = (10-30 %)
effective_cache_size =3D7GB (70-75 %)=C2=A0 =C2=A0----&= gt;>(shared_buffers+page cache) for dedicated server only
work= _mem =3D 128MB=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(0.3-1 %)
mainten= ance_work_mem =3D 512MB (0.5-4 % )
temp_Buffer =3D=C2=A0 8MB=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--= -->>default is better( setting can be changed within individual sessi= ons)

checkpoint_segments =3D 64
checkpoi= nt_completion_target =3D 0.9
random_page_cost =3D 3.5
c= pu_tuple_cost =3D 0.05
wal_buffers =3D 32MB=C2=A0 leave this defa= ult 3% of shared buffer is better



is it better or do i want to modify any thing
=

our server is getting too slow again and again

please give me a suggestion
--001a113d720ef43033055bbabfd2-- From laurenz.albe@cybertec.at Thu Oct 19 12:51:59 2017 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5AJ3-0003dw-9D for pgsql-performance@arkaria.postgresql.org; Thu, 19 Oct 2017 12:52:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e5AJ2-0006pK-Rv for pgsql-performance@arkaria.postgresql.org; Thu, 19 Oct 2017 12:52:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e5AJ2-0006oj-2B for pgsql-performance@postgresql.org; Thu, 19 Oct 2017 12:52:12 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e5AIv-0000oj-8C for pgsql-performance@postgresql.org; Thu, 19 Oct 2017 12:52:11 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 55B6946D64; Thu, 19 Oct 2017 14:52:03 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id 2KXX0rUeuCOg; Thu, 19 Oct 2017 14:52:01 +0200 (CEST) Message-ID: <1508417519.2574.18.camel@cybertec.at> Subject: Re: memory allocation From: Laurenz Albe To: nijam J , pgsql-performance@postgresql.org Date: Thu, 19 Oct 2017 14:51:59 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org nijam J wrote: > our server is getting too slow again and again Use "vmstat 1" and "iostat -mNx 1" to see if you are running out of memory, CPU capacity or I/O bandwith. Figure out if the slowness is due to slow queries or an overloaded system. Yours, Laurenz Albe -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance