Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dovwP-0007uN-AT for pgsql-performance@arkaria.postgresql.org; Mon, 04 Sep 2017 18:17:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dovwO-0008K7-QB for pgsql-performance@arkaria.postgresql.org; Mon, 04 Sep 2017 18:17:44 +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 1dovuZ-0000kU-Kb for pgsql-performance@postgresql.org; Mon, 04 Sep 2017 18:15:51 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dovuS-0001wO-M3 for pgsql-performance@postgresql.org; Mon, 04 Sep 2017 18:15:51 +0000 Received: by mail-qt0-x242.google.com with SMTP id 12so748829qtn.5 for ; Mon, 04 Sep 2017 11:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=WqSBKIUDVDU8CEQxl3eAdWH3oJbyFcIKWCNKcmy21To=; b=M38GgwEUFCAy3eJbHiYbiPjcPhWkCagTNtOZeyidJBr5BQk1+dZrw9JHinVAjFCLNk BNHLWQkVMafoO79quIlSdvINE6wplT1sv3eAR30Nz1mAgg+/lKFbVLeWHE98Eq0mhfSv //7WwBPpUwj1Y9ekSCz//Twa071zq3TMj9OvHfuxKhMzbzFcf/nYaXJnaMlc2U7VisyY 2kbCMXAtdSIF9he4OIJNcuZwb6/G1ldJVuOByB2rNgZlSSUrDmWy92tgS+jesdf48BuR CQY6rOBXgMXVr/aoGZKOeTvTUycLsRQU8dQtdwmmLYNZJ7Y84kxu9ukR/EkMNJs35kTe YWCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=WqSBKIUDVDU8CEQxl3eAdWH3oJbyFcIKWCNKcmy21To=; b=BIZYCn41cUOhyLNnaw2aJelVRodOpwaWpoE4b6w+HQH0A39fE4NcTv13OL35xmzgcF 60Q3HCQJMuOGMtXoGt9vYV/R5hX4GpjthwZpJGVJZxjJzGm6aTQoWVIa+PdWgLgF9b7l nPrawEGJzi8B2KFSSxU0YGAXgN27qigYSy/M53MkCrgTAyNd4I1o08K4lR/z8Mz5e01/ 5EQAr0H/ZvcZI4XRiz+PH41IVeBTmaTwFvXhYjrbQaYBoQFyGm8QGyXKzyxOT61g3EC2 SAbswUvms/hUMp1WRxx8HG2TXUUbvz5iLtVpaBuBH/5aXp0C99siBSjNGEjmzDbiWVXR pRRA== X-Gm-Message-State: AHPjjUj+Jx3QNnliJGYyg5EvKkVdjvLD4x6K/VkqwZsXJUMm+COmp+CN g4WgM+t+y7xcooIZ+Xk2Q56pFyT8VA== X-Google-Smtp-Source: ADKCNb60+C5gZ3NPO6IRhmDtci3ZW3sVOdYLdwyEWfo6IXvABOxuVUhePVCeMPBrbKg7Z14V5gYzjS3XzbnXpojq19k= X-Received: by 10.237.42.231 with SMTP id t94mr1842999qtd.176.1504548942604; Mon, 04 Sep 2017 11:15:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.105.164 with HTTP; Mon, 4 Sep 2017 11:15:42 -0700 (PDT) In-Reply-To: References: From: Scott Marlowe Date: Mon, 4 Sep 2017 12:15:42 -0600 Message-ID: Subject: Re: Handling small inserts from many connections. To: =?UTF-8?B?7Jqw7ISx66+8?= Cc: "pgsql-performance@postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Mon, Sep 4, 2017 at 2:14 AM, =EC=9A=B0=EC=84=B1=EB=AF=BC wrote: > Hi team, > > I'm trying to configure postgres and pgbouncer to handle many inserts from > many connections. > > Here's some details about what i want to achieve : > > We have more than 3000 client connections, and my server program forks > backend process for each client connections. 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. 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. > 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. 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 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance