Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYeKE-0000KQ-SG for pgsql-interfaces@arkaria.postgresql.org; Sun, 05 Mar 2023 02:42:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pYeKC-0000Bz-9H for pgsql-interfaces@arkaria.postgresql.org; Sun, 05 Mar 2023 02:42:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYeKB-0000Bq-VT for pgsql-interfaces@lists.postgresql.org; Sun, 05 Mar 2023 02:42:12 +0000 Received: from forward501c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d501]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYeK9-00077c-H2 for pgsql-interfaces@lists.postgresql.org; Sun, 05 Mar 2023 02:42:11 +0000 Received: from iva5-2844a9b35ab5.qloud-c.yandex.net (iva5-2844a9b35ab5.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:5a18:0:640:2844:a9b3]) by forward501c.mail.yandex.net (Yandex) with ESMTP id BA54A5EBF7 for ; Sun, 5 Mar 2023 05:42:06 +0300 (MSK) Received: from mail.yandex.ru (2a02:6b8:c0c:82c:0:640:3bc8:0 [2a02:6b8:c0c:82c:0:640:3bc8:0]) by iva5-2844a9b35ab5.qloud-c.yandex.net (mxback/Yandex) with HTTP id cfOBNr2Y8W21-i2aYfyO8; Sun, 05 Mar 2023 05:42:06 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1677984126; bh=rGt/IgQPnuMcz3tnn1nl6kdIGKQOmt+y1EtTmgmVIOw=; h=Message-Id:Date:Subject:To:From; b=gn02BYF1haiDG2wJ1HItWToHfoaLxmM1ZK6qiMfzZ4E2IWzbf5eHgRIsCRDwYVTSw 7SbWU7+vPfNK3BAoo6rlUTjLXrIz0KV73eQzfIpk9sCr4i/NQYamwVBBcxvlhV+wHd QaCs6xEpKbwrAmhrxY4nNjnChrjWdDHrdwfHTI0Q= Authentication-Results: iva5-2844a9b35ab5.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by 27xaqkpzcgytqbgl.iva.yp-c.yandex.net with HTTP; Sun, 05 Mar 2023 05:42:06 +0300 From: =?utf-8?B?0KLRgNC+0YTQuNC80L7QsiDQmNCy0LDQvQ==?= Envelope-From: i-trofimow@yandex.ru To: "pgsql-interfaces@lists.postgresql.org" Subject: About default inBufSize (connection read buffer size) in libpq MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 05 Mar 2023 05:42:06 +0300 Message-Id: <298631677983213@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk
Hi!
 
I was running some benchmarks for PG driver built on top of libpq async functionality,
and noticed that recv syscalls issued by the application are limited by 16Kb, which seems to
be inBufSize coming from makeEmptyPGconn in interfaces/libpq/fe-connect.c.
 
Hacking that to higher values allowed my benchmarks to issue drastically less syscalls
when running some heavy selects, both in local and cloud environments, which made them
significantly faster.
 
I believe there is a reason for that value to be 16Kb, but i was wondering if it's safe to change
this default to user-provided value, and if it is - could this functionality be added into API?