Re: Killed background writer process

From: Vijaykumar Jain <vijaykumarjain(dot)github(at)gmail(dot)com>
To: Raj kumar <rajkumar820999(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Killed background writer process
Date: 2021-06-04 09:46:42
Message-ID: CAM+6J96J0xx6HyBfX++2pdSF4dCrPyFf=N4hQkm42HQK7gSe4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PostgreSQL: Documentation: 13: 19.4. Resource Consumption
<https://www.postgresql.org/docs/current/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-BACKGROUND-WRITER>
There is a separate server process called the *background writer*, whose
function is to issue writes of “dirty” (new or modified) shared buffers.
When the number of clean shared buffers appears to be insufficient, the
background writer writes some dirty buffers to the file system and marks
them as clean. This reduces the likelihood that server processes handling
user queries will be unable to find clean buffers and have to write dirty
buffers themselves. However, the background writer does cause a net overall
increase in I/O load, because while a repeatedly-dirtied page might
otherwise be written only once per checkpoint interval, the background
writer might write it several times as it is dirtied in the same interval.
The parameters discussed in this subsection can be used to tune the
behavior for local needs.

postgres/README at bc2a389efb3b52d259cefd53c16cfa00742116f2 ·
postgres/postgres (github.com)
<https://github.com/postgres/postgres/blob/bc2a389efb3b52d259cefd53c16cfa00742116f2/src/backend/storage/buffer/README#L249>

I believe the postmaster checks if it is running, if not it starts again
i think.
in source.
postgres/postmaster.c at bc2a389efb3b52d259cefd53c16cfa00742116f2 ·
postgres/postgres (github.com)
<https://github.com/postgres/postgres/blob/bc2a389efb3b52d259cefd53c16cfa00742116f2/src/backend/postmaster/postmaster.c#L1763>

The same goes for wal writer as well.

On Fri, 4 Jun 2021 at 14:55, Raj kumar <rajkumar820999(at)gmail(dot)com> wrote:

> Hi Team,
>
> I've killed background writer process for a testing purpose. I found that
> after sometime it automatically came up with a new PID without me doing
> anything from my end.
>
> How postgres automatically brings it up? Is there any impact on the
> Database and connections?
>
> Thanks,
> Raj Kumar Narendiran
>

--
Thanks,
Vijay
Mumbai, India

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2021-06-04 09:51:20 Re: Killed background writer process
Previous Message Raj kumar 2021-06-04 09:24:48 Killed background writer process