From fde7b4a742fc9cfe4a8a44bcb07ffd9859b9006b Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Sun, 8 Nov 2015 12:36:33 +0200 Subject: [PATCH] Increase pkt_buf to 4k Apparently (#87) TLS performs better with larger buffer. The behaviour is probably load-specific, but it should be safe to do as since v1.2 the packet buffers are split from connections and used lazily from pool. In fact the pkt_buf should have been increased in v1.2. --- doc/config.rst | 2 +- etc/pgbouncer.ini | 2 +- src/main.c | 2 +- test/test.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index 4fd86ed..f37e939 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -718,7 +718,7 @@ Internal buffer size for packets. Affects size of TCP packets sent and general memory usage. Actual libpq packets can be larger than this so, no need to set it large. -Default: 2048 +Default: 4096 max_packet_size --------------- diff --git a/etc/pgbouncer.ini b/etc/pgbouncer.ini index 27979aa..f1940e7 100644 --- a/etc/pgbouncer.ini +++ b/etc/pgbouncer.ini @@ -222,7 +222,7 @@ default_pool_size = 20 ;;; ;; buffer for streaming packets -;pkt_buf = 2048 +;pkt_buf = 4096 ;; man 2 listen ;listen_backlog = 128 diff --git a/src/main.c b/src/main.c index b053a9a..78039bd 100644 --- a/src/main.c +++ b/src/main.c @@ -250,7 +250,7 @@ CF_ABS("dns_nxdomain_ttl", CF_TIME_USEC, cf_dns_nxdomain_ttl, 0, "15"), CF_ABS("dns_zone_check_period", CF_TIME_USEC, cf_dns_zone_check_period, 0, "0"), CF_ABS("max_packet_size", CF_UINT, cf_max_packet_size, 0, "2147483647"), -CF_ABS("pkt_buf", CF_INT, cf_sbuf_len, CF_NO_RELOAD, "2048"), +CF_ABS("pkt_buf", CF_INT, cf_sbuf_len, CF_NO_RELOAD, "4096"), CF_ABS("sbuf_loopcnt", CF_INT, cf_sbuf_loopcnt, 0, "5"), CF_ABS("tcp_defer_accept", DEFER_OPS, cf_tcp_defer_accept, 0, NULL), CF_ABS("tcp_socket_buffer", CF_INT, cf_tcp_socket_buffer, 0, "0"), diff --git a/test/test.ini b/test/test.ini index dd6bbcf..bd2254d 100644 --- a/test/test.ini +++ b/test/test.ini @@ -99,7 +99,7 @@ client_idle_timeout = 0 ;;; ; buffer for streaming packets -pkt_buf = 2048 +;pkt_buf = 4096 ;;; ;;; networking options, for info: man 7 tcp -- 2.40.0