Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s769b-003cXH-N3 for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2024 04:22:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s769b-008ZLJ-Di for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2024 04:22:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s769a-008ZL9-TI for pgsql-general@lists.postgresql.org; Wed, 15 May 2024 04:22:11 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s769W-000IvU-Ew for pgsql-general@lists.postgresql.org; Wed, 15 May 2024 04:22:10 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5238b5c07efso723950e87.3 for ; Tue, 14 May 2024 21:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitnine-net.20230601.gappssmtp.com; s=20230601; t=1715746924; x=1716351724; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MKkENf2nlYegJnQ6KLr4T841hOGLtVSfmfBqO8+dS8A=; b=F6zgdM305vM9R8AxBQFjyobHda+Blmt574wdRRGZTsWa6ejIb3st7ztkYn6kx2ZWFs CXxRS489ylZFiJbma62/4waMkE59p5kSz5ZPxMYZ5B/T62Roo0TsVfAxZXKUX+UL6CAx rEzMN5l6E7lf4rp2H4q6dp2ENoFf90GP8WBApvp3A/y55fI/tm530LnvsWcXmrcyLOk0 7PmrNce2fYFYnQUfAif1kStNlu0TwEEntgAEkPQaZyQG1gIn/QP29gkd+L2ype4ZCtGM zNVAAm8p0/A2QLr6gSEc8w5MEqSXpeKRk4t6tg5zrwSdUfHUxpbRXvsEn/b5PYAXKLwE gFXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715746924; x=1716351724; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MKkENf2nlYegJnQ6KLr4T841hOGLtVSfmfBqO8+dS8A=; b=cSNxRwUWu/p9x4wxElxPNGzoM+8hGJrJdrDRRvRHbY3hBsHmX3pu4cCZNUeeGp27x0 2LGxo3Ku0cqzW+z3tR4jtGNr+FfK+bG6G/afSrjYODDxht21HsSj0D0pDRavoOQDxDmy HQ8d5LnM/e3Eyi4fheACOehgT/xoKxKD28zk5JQKzoXlh9UtxINuUtuRhdCaM16Pq5dr w9Mxic2bNVu3mnSnodx5CSgEFM/iNnYXusRWKtwsPjNfJ7BXKUErYh29+FV7LSetR6p3 bOp8fb9pVfuY1hS/ibq+8CAavBwe6uW0XOwm8Amj1MD4EHDq9JV0qP0rYy1r9DlZj6GD VTEA== X-Gm-Message-State: AOJu0YzbrJ8lSloBnmj6khv8i8PfXsUMaTz6NZG7kvfI8e+By/a821vs 82CcveWCkVt8/LkjpmAaSdxtWv+WPiVGYSWwLlGXFUm+TqDpOxk/ZWq1hE9vgb1Yoj//w9gcf55 AX0/Ovp+SOmEPOpc/Hfd2u7qxiaBl/FWxGDw5IQ== X-Google-Smtp-Source: AGHT+IGntrPgSfuk4dfIA+T+jc6pmHGZbbV/msNWuISRUGBLwjfuaPx2IZeiBeLHibtRSjdxYXwue0X7Jy4DRDXYcnM= X-Received: by 2002:a05:6512:1094:b0:51d:1830:8380 with SMTP id 2adb3069b0e04-5220fa71925mr11327779e87.8.1715746924223; Tue, 14 May 2024 21:22:04 -0700 (PDT) MIME-Version: 1.0 References: <2e9b2b7b-79a1-a7f2-e05e-9cefda601c09@gmx.net> In-Reply-To: <2e9b2b7b-79a1-a7f2-e05e-9cefda601c09@gmx.net> From: Muhammad Imtiaz Date: Wed, 15 May 2024 09:21:52 +0500 Message-ID: Subject: Re: pg_stat_io clarifications: background worker, writes and reads To: Dimitrios Apostolou Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000f17eaa061876755c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f17eaa061876755c Content-Type: text/plain; charset="UTF-8" Hi, In PostgreSQL, the pg_stat_io view provides detailed statistics on I/O operations. Background process perform maintenance tasks and other background operations essential to the functioning of the PostgreSQL database. They include processes such as: 1. Autovacuum Workers 2. WAL Writer 3. Background Writer 4. Logical Replication Workers 5. Custom Background Workers In the pg_stat_io view, statistics related to I/O operations performed by these background workers are recorded. Regards, Imtiaz On Wed, 15 May 2024, 01:26 Dimitrios Apostolou, wrote: > Hello list, > > what is the "background worker" in the pg_stat_io statistics view? I'm > reading the documentation but can't figure this one out knowing that it is > not autovacuum or bgwriter. And I'm not aware of any extension I might > have with registered background worker. > > Additionally, how can it be evictions > writes? I would expect every > eviction to cause a write. > > Finally about "hits", I understand they are reads found in shared_buffers, > so they never registered into the "reads" counter. So is "reads" in > pg_stat_io the equivalent to misses, i.e. the opposite of "hits", the read > attempts not found in the shared_buffers, that needed to be fetched from > the disk (or OS buffercache)? > > backend_type | object | context | reads | read_time | > writes | write_time | writebacks | writeback_time | extends | extend_time | > op_bytes | hits | evictions | reuses | fsyncs | fsync_time | > stats_reset > > -------------------+---------------+---------+---------+-------------+--------+------------+------------+----------------+---------+-------------+----------+-----------+-----------+--------+--------+------------+------------------------------- > background worker | relation | normal | 5139575 | 2196288.011 | > 63277 | 1766.94 | 0 | 0 | 0 | 0 | > 8192 | 876913705 | 5139653 | | 0 | 0 | 2024-04-08 > 08:50:02.971192+00 > > > Thank you in advance, > Dimitris > > > > --000000000000f17eaa061876755c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

In PostgreSQL, the pg_stat_io view provides detailed statis= tics on I/O operations. Background process perform maintenance tasks and ot= her background operations essential to the functioning of the PostgreSQL da= tabase.
They include processes such as:

1. Autovacuum Workers
2. WAL Writer
3. Background Writer
4. Logical Replication Workers
5. Cu= stom Background Workers

= In the pg_stat_io view, statistics related to I/O operations performed by t= hese background workers are recorded.=C2=A0

Regards,
Imtiaz


On Wed, 15 May 2024, 01:26 Dimitrios Apostolou, <jimis@gmx.net> wrote:
Hello list,

what is the "background worker" in the pg_stat_io statistics view= ? I'm
reading the documentation but can't figure this one out knowing that it= is
not autovacuum or bgwriter. And I'm not aware of any extension I might<= br> have with registered background worker.

Additionally, how can it be evictions > writes? I would expect every
eviction to cause a write.

Finally about "hits", I understand they are reads found in shared= _buffers,
so they never registered into the "reads" counter. So is "re= ads" in
pg_stat_io the equivalent to misses, i.e. the opposite of "hits",= the read
attempts not found in the shared_buffers, that needed to be fetched from the disk (or OS buffercache)?

=C2=A0 =C2=A0 backend_type=C2=A0 =C2=A0 |=C2=A0 =C2=A0 object=C2=A0 =C2=A0 = =C2=A0| context |=C2=A0 reads=C2=A0 |=C2=A0 read_time=C2=A0 | writes | writ= e_time | writebacks | writeback_time | extends | extend_time | op_bytes |= =C2=A0 =C2=A0hits=C2=A0 =C2=A0 | evictions | reuses | fsyncs | fsync_time |= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats_reset
-------------------+---------------+---------+---------+-------------+-----= ---+------------+------------+----------------+---------+-------------+----= ------+-----------+-----------+--------+--------+------------+-------------= ------------------
=C2=A0 background worker | relation=C2=A0 =C2=A0 =C2=A0 | normal=C2=A0 | 51= 39575 | 2196288.011 |=C2=A0 63277 |=C2=A0 =C2=A0 1766.94 |=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 |= =C2=A0 =C2=A0 =C2=A0 =C2=A00 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 |= =C2=A0 =C2=A0 =C2=A08192 | 876913705 |=C2=A0 =C2=A05139653 |=C2=A0 =C2=A0 = =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0= | 2024-04-08 08:50:02.971192+00


Thank you in advance,
Dimitris



--000000000000f17eaa061876755c--