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 1s75sB-003aU7-Dy for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2024 04:04:12 +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 1s75sB-008Kpi-D0 for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2024 04:04: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 1s75sB-008Kpa-0Z for pgsql-general@lists.postgresql.org; Wed, 15 May 2024 04:04:11 +0000 Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s75s7-000Iot-75 for pgsql-general@lists.postgresql.org; Wed, 15 May 2024 04:04:10 +0000 Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-4df265f634aso2106915e0c.3 for ; Tue, 14 May 2024 21:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715745846; x=1716350646; 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=jJE/kHRgChKwttGfKfX+ca2nojdLdNVZPetzqSWllOA=; b=nToRaVLd8Qsg3T64N2k0JE/LVWq32/D1NJ1dsjmqlNxbU1yJUvMmdSgcl+sMXyAZY1 5sXHmuVn+NfIqmmREntkt+yzNXfBj/EO1yscDMfkvwBS5jeSDYbN8rMOoJR27z3uOdD/ 1fbEedLLS8yZnoaU1UenZvOV3kfpEg+8LcoPFmQ87W+HIeQHiFC18rd7Qn9jkIR+QD/6 ffLCS/Ip1uYOZQawPsRz7NXXdYoW5aSxj7mxtYsB2xb+XDn/8cwt3ltF+SrANx8IE7Xa 5JxBA+SmDRtnSS3nJ2AZxfEDNpOtJ4liRxwIUVRoPzCRHjbwrJVMlRXVtVO7bhkOounL Phlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715745846; x=1716350646; 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=jJE/kHRgChKwttGfKfX+ca2nojdLdNVZPetzqSWllOA=; b=s8TKguC6WwkUqbQQR09CECeUbMWcAeX1OOk/ZRVKNbNFvvdygNSKutWBSmGpuJeQRd oS532aAOA4ajiyxZFddixugmxxSZHMCCu55aghnzr6059bkuhpABlz6XrSM8NqDNL28B cqGqYkLo/tOA9rX+Pl9112urcIrXFjFIZp71h+Z/2NvsBcRUX31zPBXsJwYPaOZIAk8r /gttmKC+2nPuAkGB0uNeeapjYbNnQKa10Lj+6K2ZcN8WrnUcgq9dE51Wfz7GaPdiysGR +gWypTcXtGmNkUW5DtFxlzEHm2KRm45vBXz5EAs/l35PAGs1ywiorSFbfGjfSMN9cWrU TivQ== X-Gm-Message-State: AOJu0YzAT+b5YhfiI0MsuCdc0Z/e/Dpxw+ARjWjtY9MZHFW5iZ20HOiz ikd3kPMNk3wderQc1L7GXXBukPqLVKNs0pTK6wH97uIa6NUNYATTBvuukUso9b0y6ay3AS6C+qf tj6nXNOBJb0NRMRxkea1u9FuCaq4= X-Google-Smtp-Source: AGHT+IFpCI0UdAJB/uKh6QVY7ucF7xN09XIvzU/1rxPn6kB7v/+4mNTDiCkxPiVLZrww5xKu5ttBLSly9Yj8M/i/9qs= X-Received: by 2002:a05:6122:3699:b0:4d8:797b:94df with SMTP id 71dfb90a1353d-4df88285592mr12793003e0c.2.1715745846070; Tue, 14 May 2024 21:04:06 -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: Kashif Zeeshan Date: Wed, 15 May 2024 09:03:55 +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="000000000000ae15870618763507" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ae15870618763507 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi background workers are used to perform tasks on db e.g. I/O, replication, clone schema, vacuum etc, you can find more details on following links. https://www.postgresql.org/docs/current/bgworker.html#:~:text=3DPostgreSQL%= 20can%20be%20extended%20to,linked%20to%20the%20server's%20status . Regards Kashif Zeeshan Bitnine On Wed, May 15, 2024 at 1:26=E2=80=AFAM 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 i= s > 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 rea= d > 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 > > > > --000000000000ae15870618763507 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

background workers are used to perfo= rm=C2=A0tasks on db e.g. I/O, replication, clone schema, vacuum=C2=A0etc, y= ou can find more details on following links.


Regards
Kashif Zeeshan
Bit= nine

On Wed, May 15, 2024 at 1:26=E2=80=AFAM Dimitrios Apostolou <<= a href=3D"mailto:jimis@gmx.net">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



--000000000000ae15870618763507--