Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQdVd-0003kK-7Z for pgsql-admin@arkaria.postgresql.org; Fri, 22 Jul 2016 16:41:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bQdVc-0006Hc-Br for pgsql-admin@arkaria.postgresql.org; Fri, 22 Jul 2016 16:41:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bQdVa-0006G0-P2 for pgsql-admin@postgresql.org; Fri, 22 Jul 2016 16:41:06 +0000 Received: from imx6.etecsa.cu ([200.55.152.141]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQdVS-00056k-HU for pgsql-admin@postgresql.org; Fri, 22 Jul 2016 16:41:05 +0000 Received: from nodo1.etecsa.cu (unknown [192.168.91.200]) by imx6.etecsa.cu (Postfix) with ESMTP id 17BEFA8; Fri, 22 Jul 2016 12:40:54 -0400 (CDT) Received: from webmail.etecsa.cu (unknown [192.168.91.6]) by nodo1.etecsa.cu (Postfix) with ESMTP id 075F9320664A; Fri, 22 Jul 2016 12:40:54 -0400 (CDT) Received: from 192.168.207.54 (SquirrelMail authenticated user gilberto.castillo) by webmail.etecsa.cu with HTTP; Fri, 22 Jul 2016 12:41:28 -0500 (GMT+5) Message-ID: <60070.192.168.207.54.1469209288.squirrel@webmail.etecsa.cu> In-Reply-To: References: Date: Fri, 22 Jul 2016 12:41:28 -0500 (GMT+5) Subject: Re: [MASSMAIL]Re: High-end PG database configuration help From: "Gilberto Castillo" To: "Scott Marlowe" Cc: "Gupta, Amar Nath" , "pgsql-admin@postgresql.org" Reply-To: gilberto.castillo@etecsa.cu User-Agent: SquirrelMail/1.4.8-5.el5_4.10 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 99749 [Jul 22 2016] X-KLMS-AntiSpam-Version: 5.5.9.33 X-KLMS-AntiSpam-Envelope-From: gilberto.castillo@etecsa.cu X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Moebius-Timestamps: 4241716, 4241754, 4241617 X-KLMS-AntiSpam-Info: LuaCore: 506 506 6ef799202ba50e109a38175aefe4f931da291fb7, {msgid_created_by_recepient}, Auth:dkim=none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2016/07/21 14:54:29 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2016/07/22 11:13:00 #7400033 X-KLMS-AntiVirus-Status: Clean, skipped X-Pg-Spam-Score: -3.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 > On Fri, Jul 22, 2016 at 1:57 AM, Gupta, Amar Nath > wrote: >> Many thanks for your reply Scott, >> >> Point#1: we have two DB servers (web app and reporting database). Web >> app does simple read and insert query + some complex queries. And >> reporting DB is used for heave queries >> Point#2: will do in next update ;) >> Point#3: I'll check for that. >> Point#4: Agreed, opening 2000 connection is not a good idea. Somehow my >> application is setup in this way I cannot use pgpool, but working on it >> in long term. >> Point#5: I have setup 32GB for that. >> >> Server current configuration is: >> max_connections = 2000 >> shared_buffers = 32GB >> work_mem = 128MB >> synchronous_commit = off >> effective_cache_size = 192GB >> >> rest settings are on default > > Which of your two dbs has 2,000 connections and needs tuning, the > reporting db or the web db? > > Two points: > > 1: Rarely if ever is 32GB needed for shared_buffers. There's a cost to > have more shared_buffers and it's pretty rare that anything over 1 or > 2GB is needed. If you have a performance test showing you need more > than a few G then yes, go for it. > > 2: You've got to get max_connections down to something reasonable. > Look at pgbouncer. It's super easy to setup and will allow you to drop > the # connections to 100 or so even for busy dbs with lots of users > etc. > > Maybe may use pg_tunning in you server, following your recomendation. Other Case, Use pgbounce for those conection. -- Saludos, Gilberto Castillo ETECSA, La Habana, Cuba -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin