Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dozVu-0000aR-CT for pgsql-performance@arkaria.postgresql.org; Mon, 04 Sep 2017 22:06:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dozVt-0005IS-Uz for pgsql-performance@arkaria.postgresql.org; Mon, 04 Sep 2017 22:06:38 +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 1dozVt-0005IG-I4 for pgsql-performance@postgresql.org; Mon, 04 Sep 2017 22:06:37 +0000 Received: from mout.perfora.net ([74.208.4.196]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dozVm-0007CD-6H for pgsql-performance@postgresql.org; Mon, 04 Sep 2017 22:06:37 +0000 Received: from [192.168.3.151] ([68.84.4.95]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LhuDc-1dBr8K1Epe-00n6CP; Tue, 05 Sep 2017 00:06:26 +0200 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Handling small inserts from many connections. From: "Michaeldba@sqlexec.com" X-Mailer: iPad Mail (14G60) In-Reply-To: Date: Mon, 4 Sep 2017 18:06:24 -0400 Cc: =?utf-8?B?7Jqw7ISx66+8?= , "pgsql-performance@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Scott Marlowe X-Provags-ID: V03:K0:Y4MuVo2CViQgTeLTAceV/x9Dqv0BEVM9koj79Gfp/FJFmBdkCwl krCOQLpcC9ULiTPZq7SNXAh6xk5w/A69FFSrAcHls+Ykwt6xk/8MFhMMh+dm785J9AGJ5P/ f3Qeb/xseoCecQFiCSo3soF2jKwB1gzq7/y48EQ4Jmy1L7RhP4cR+KNiqdjJjEAZt189xeN JJuT2/i6O8dGzK/61i+JQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:PcOAvS5zUyw=:Gy0uCbfajErpmJ/fOiT/TB zSc+9xAEtq8b3hMCZQvX7kJ+vfqNGtKZ3QF0LREObgL5wX+1Vgk8eCCNY40llvilxXebUbTEc jA128R+UfyqeQN++FXtxnFOqGwrtTg2mzy4bRwh8DScZSN/102IyzDMT8EfxUooIF7KamNbhu rgXf02JA49k/CU9O8z4nYVbx3pfMGBSa9mY0oI6QAwgHN7TtMl/X3GN0D4s4UU8CwO/h8GxE9 jb+IzkWBGzwbMcs6QiyzFsPx4oHHLYyT4eNG+YoeXNI1TSRCZWPL/2q6CMWSYGVAFWOwws0Ml bPqH9+oN07bZffelMzF+YWG56asztiO3qqjCEV9SMdeDlEPEH/BJRl1CLKjQVmoheuZNp9i6e IO3dSTNPk875bc6qed4bo6fhxc7lh9E0kx27LsPkM9ihn2uSrMhPlshyatLmWr+5/LVsrMw0H w9boZqpYjnoK7xfQV4OFn0gdASx6EW2R4r3fis4Fs0iVxDSENAMi6TO0rr+santL0YJLc5k6F kafNzIq3PE5cQ3tz0yKH70ht/yEsAGmQDh2V/HUdBGVI0wTq/wn1OSx9qf0TwRYV3M46YtDAP fMRy7HcrkbPZaM13ujFRVEEwRcAJAeA9HA3vYNP51pDFu2r5DB8uPuBZ7g0AuO0au6VmDsA4G zzeeioQ+h5N8uVSkqvdH+LVTJYEJpu2YiE34K8WUFs+taWkgbscZLc9nQmv+NDg6l3r4xCU1x 6qVEzZJtz0p7hyl/USDGrmWX39Jpuuq7u5EnAsApt6cYGHu1l6DpEzJxGxQ= 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 Jumping on Scott's observation, assuming you really do have a lot of active= connections (idle ones usually are not a problem) a general rule of thumb = for not overloading your system is keep your active connections less than (= 2-3) * (number so cpus). Sent from my iPad > On Sep 4, 2017, at 2:15 PM, Scott Marlowe wrote: >=20 >> On Mon, Sep 4, 2017 at 2:14 AM, =EC=9A=B0=EC=84=B1=EB=AF=BC wrote: >> Hi team, >>=20 >> I'm trying to configure postgres and pgbouncer to handle many inserts fr= om >> many connections. >>=20 >> Here's some details about what i want to achieve : >>=20 >> We have more than 3000 client connections, and my server program forks >> backend process for each client connections. >=20 > This is a terrible configuration for any kind of performance. Under > load all 3,000 connections can quickly swamp your server resulting in > it slowing to a crawl. >=20 > Get a connection pooler involved. I suggest pgbouncer unless you have > very odd pooling needs. It's easy, small, and fast. Funnel those 3,000 > connections down to <100 if you can. It will make a huge difference in > performance and reliability. >=20 >> System information : >> PGBouncer 1.7.2. >> PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 >> 20120313 (Red Hat 4.4.7-18), 64-bit on CentOS release 6.9 (Final). >> Kernel version 2.6.32-696.10.1.el6.x86_64 >> Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz processor. >> 32GB ECC/REG-Buffered RAM. >> 128GB Samsung 840 evo SSD. >=20 > If it's still slow after connection pooling is setup, then look at > throwing more SSDs at the problem. If you're using a HW RAID > controller, turn off caching with SSDs unless you can prove it's > faster with it. It almost never is. >=20 >=20 > --=20 > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance