Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1domXZ-0005oj-BS for pgsql-performance@arkaria.postgresql.org; Mon, 04 Sep 2017 08:15:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1domXY-0006Iy-CZ for pgsql-performance@arkaria.postgresql.org; Mon, 04 Sep 2017 08:15:28 +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 1domXW-0006Ho-6U for pgsql-performance@postgresql.org; Mon, 04 Sep 2017 08:15:26 +0000 Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1domXS-0005tp-7Y for pgsql-performance@postgresql.org; Mon, 04 Sep 2017 08:15:25 +0000 Received: by mail-qk0-x234.google.com with SMTP id o63so19382672qkb.3 for ; Mon, 04 Sep 2017 01:15:21 -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=ugKwY4TgKhofRdpJoFhTcyELHC6YNKGu8eAnJCT6zPY=; b=a0Ta4PUIRXNLw0qw0SSweP6vo1u7jrRm1e3jaW7Cy08xgDQaQk0lfbYCgAUFye7coI OvMTe4nwuf5PAlkDiLjSlkOjDw1pcO475S8eZi+cV9gyTlQ1VAmhpYGlW29RlrZikkHf GEdgOpBi40nVqjfGbOV5u7kFwnesJaxmUtI04P5HNHnTNlf6Ue0y22iJV8FgNplSlgSw XR1oV+RQpd3ZPWB1VL2Uu/LIun75r23bCJ7Es90qp+ZzSEpUsZDvWoDhVkbIA2FajI1Z aTCj5hBUwBuD0OJ7NxqIT9gW5uYWtT1xjGcX0l622JJALkWJj9pAEDFKvln4rygWInjM 1GJg== 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=ugKwY4TgKhofRdpJoFhTcyELHC6YNKGu8eAnJCT6zPY=; b=rO3xmyBlIukLb2Y4EO9egaNihLITiBRWYkCzM76flQC76SF/U777Q8lpHynE53X0+B 4bGKnrdy1RxM1E2L5UzDo1s9P3e061lQLTMDxejRbfz2W/GIENJi8lJBfRGcHGBuz2vJ VOZgVEWcO9ztWPHTJl2XzjNKmi0M+iPutgXJUNNfoDUIWS1opzspqGxmau3KpCxpvZEz 5XGj9owoKZDuLOO0Pul9GYcGaYJbnqdWi/DRxHAWBXGT8Ti7n5MvloAfqxmqUQy76/oz 4zPv7SftXuJAqoy3QtqOK39Hx1nuVWo+zRsoDtwti9hhLjfewpJ1G/Jfnzb/bKoOU94t XC6g== X-Gm-Message-State: AHPjjUgPNI8FHHNlgiB8riX0mlMakmn80yQlAnDSDhFKIIJhR0PCvIwl 6GklZ75r56mDx/y8z7B8cyp4gKQD+93j X-Google-Smtp-Source: ADKCNb5DNYWuyIxOuPB8dOovBs/Ai5SmBm/FYhzK/vgRaGNgDF6EmjwkTa1eNZBJRfvQ32Ty5wTug1OuknSqVaqDjtY= X-Received: by 10.55.76.135 with SMTP id z129mr13577278qka.264.1504512920365; Mon, 04 Sep 2017 01:15:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.42.135 with HTTP; Mon, 4 Sep 2017 01:14:39 -0700 (PDT) From: =?UTF-8?B?7Jqw7ISx66+8?= Date: Mon, 4 Sep 2017 17:14:39 +0900 Message-ID: Subject: Handling small inserts from many connections. To: pgsql-performance@postgresql.org Content-Type: multipart/mixed; boundary="94eb2c0595022dced3055858b6fa" 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 --94eb2c0595022dced3055858b6fa Content-Type: multipart/alternative; boundary="94eb2c0595022dcebf055858b6f8" --94eb2c0595022dcebf055858b6f8 Content-Type: text/plain; charset="UTF-8" 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. If backend processes send a request to its connected client, the client send some text data(about 3000 bytes) to the backend process and wait for next request. The backend process execute insert text data using PQexec from libpq lbirary, if PQexec is done, backend process send request to client again. All the inserts using one, same table. The problem is, clients wait too long due to insert process is too slow. It seems to working fine at first, but getting slows down after couple of hours, each insert query takes 3000+ ms and keep growing. Need some help to figure out an actual causes of this problem. 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. --94eb2c0595022dcebf055858b6f8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi team,

I'm trying to c= onfigure postgres and pgbouncer to handle many inserts from many connection= s.

Here's some details about what i want to ac= hieve :

=C2=A0 We have more than 3000 client conne= ctions, and my server program forks backend process for each client connect= ions.
=C2=A0 If backend processes send a request to its connected= client, the client send some text data(about 3000 bytes) to the backend pr= ocess and wait for
=C2=A0 next request.
=C2=A0= The backend process execute insert text data using PQexec from libpq lbira= ry, if PQexec is done, backend process send request to
=C2= =A0 client again.

=C2=A0 All the inserts using one= , same table.

The problem is, clients wait too= long due to insert process is too slow.
It seems to working fine= at first, but getting slows down after couple of hours,
each ins= ert query takes 3000+ ms and keep growing.

Nee= d some help to figure out an actual causes of this problem.
<= br>
System information :
=C2=A0 PGBouncer 1.7.2.
=C2=A0 PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (GC= C) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit on CentOS release 6.9 (Final).=
=C2=A0 Kernel version 2.6.32-696.10.1.el6.x86_64
= =C2=A0 Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz pro= cessor.
=C2=A0 32GB ECC/REG-Buffered RAM.
=C2=A0 128GB Samsung 840 evo SSD.


<= div>




--94eb2c0595022dcebf055858b6f8-- --94eb2c0595022dced3055858b6fa Content-Type: text/plain; charset="US-ASCII"; name="pgbouncer.ini.txt" Content-Disposition: attachment; filename="pgbouncer.ini.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j75vwcg00 cG9vbF9tb2RlID0gdHJhbnNhY3Rpb24NCg0KDQptYXhfY2xpZW50X2Nvbm4g PSAxMDAwMDANCg0KZGVmYXVsdF9wb29sX3NpemUgPSAyMDANCg== --94eb2c0595022dced3055858b6fa Content-Type: text/plain; charset="US-ASCII"; name="postgresql.conf.txt" Content-Disposition: attachment; filename="postgresql.conf.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j75vwcgh1 bWF4X2Nvbm5lY3Rpb25zID0gOTAwMCAgICAgICAgICAgICAgICAgICMgKGNo YW5nZSByZXF1aXJlcyByZXN0YXJ0KQ0Kc3VwZXJ1c2VyX3Jlc2VydmVkX2Nv bm5lY3Rpb25zID0gMSAgICAgICMgKGNoYW5nZSByZXF1aXJlcyByZXN0YXJ0 KQ0KDQpzaGFyZWRfYnVmZmVycyA9IDhHQg0KDQp3b3JrX21lbSA9IDJNQg0K DQptYWludGVuYW5jZV93b3JrX21lbSA9IDY0TUIgICAgICAgICAgICAgIyBt aW4gMU1CDQoNCmR5bmFtaWNfc2hhcmVkX21lbW9yeV90eXBlID0gcG9zaXgg ICAgICAjIHRoZSBkZWZhdWx0IGlzIHRoZSBmaXJzdCBvcHRpb24NCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIHN1cHBvcnRl ZCBieSB0aGUgb3BlcmF0aW5nIHN5c3RlbToNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAjICAgcG9zaXgNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjICAgc3lzdg0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgICB3aW5kb3dz DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAg IG1tYXANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAjIHVzZSBub25lIHRvIGRpc2FibGUgZHluYW1pYyBzaGFyZWQgbWVtb3J5 DQpzeW5jaHJvbm91c19jb21taXQgPSBvZmYNCg0Kd2FsX2J1ZmZlcnMgPSAy NTZNQg0KDQpjaGVja3BvaW50X3RpbWVvdXQgPSAxMG1pbiAgICAgICAgICAg ICAgIyByYW5nZSAzMHMtMWQNCg0KbWF4X3dhbF9zaXplID0gNDA5Nk1CDQoN Cm1pbl93YWxfc2l6ZSA9IDMwNzJNQg0KDQpjaGVja3BvaW50X2NvbXBsZXRp b25fdGFyZ2V0ID0gMS4wICAgICAgIyBjaGVja3BvaW50IHRhcmdldCBkdXJh dGlvbiwgMC4wIC0gMS4wDQoNCnJhbmRvbV9wYWdlX2Nvc3QgPSA0LjAgICAg ICAgICAgICAgICAgICAjIHNhbWUgc2NhbGUgYXMgYWJvdmUNCg0KZGVmYXVs dF9zdGF0aXN0aWNzX3RhcmdldCA9IDUwMCAgICAgICAgICMgcmFuZ2UgMS0x MDAwMA0KDQoNCg== --94eb2c0595022dced3055858b6fa Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance --94eb2c0595022dced3055858b6fa--