Re: libpq compression

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Daniil Zakhlystov <usernamedt(at)yandex-team(dot)ru>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, "o(dot)bartunov(at)postgrespro(dot)ru" <o(dot)bartunov(at)postgrespro(dot)ru>
Subject: Re: libpq compression
Date: 2020-11-02 14:02:59
Message-ID: 9d33e21e-54b2-fcf3-b90f-ced286df00c5@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It seems to be very important to be able to measure network traffic
between client and server, especially in case of using compression.
Althought there are a lot of toll for monitoring network traffix for
Linux and other OSes,  I didn't find one which can easily calculate
traffix for particular backends.
This is why I have added pg_stat_network_traffic view which can be used
to measure efficiency of protocol message compression for different
algorithms and workloads.

This is the result of network traffic of two backends one with enabled
compression and another with disable compression
after execution of "select * from pg_class" command:

select * from pg_stat_network_traffic;
  pid  | rx_raw_bytes | tx_raw_bytes | rx_compressed_bytes |
tx_compressed_bytes
-------+--------------+--------------+---------------------+---------------------
 22272 |            0 |            0 |                   0
|                   0
 22274 |            0 |            0 |                   0
|                   0
 22276 |           29 |        86327 |                  38
|               10656
 22282 |           73 |        86327 |                   0
|                   0
 22270 |            0 |            0 |                   0
|                   0
 22269 |            0 |            0 |                   0
|                   0
 22271 |            0 |            0 |                   0
|                   0
(7 rows)

--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
libpq-compression-23.patch text/x-patch 55.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2020-11-02 14:17:00 Re: Support for NSS as a libpq TLS backend
Previous Message Magnus Hagander 2020-11-02 14:02:03 Re: [patch] [doc] Clarify temporary table name shadowing in CREATE TABLE