Thread: PostgreSQL - Debian - Processes: postgres: writer process, etc.

PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Windybell
Date:
Hello,

I am running the Debian Lenny PostgreSQL package (v.8.4).
When I issue the following command:


I am wondering what are these four last processes ("postgres: writer",
"postgres: wal writer", "postgres: autovacuum launcher" and "postgres: stats
collector")?
Their PPID is 3069.
What is weird to me is the "COMMAND" column as far as these four processes
are concerned.
In the "COMMAND "column I would expect a real command, not a description.
Can you explain?
(BTW, this is a novice question I'm asking...)

Thanks and best regards.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/PostgreSQL-Debian-Processes-postgres-writer-process-etc-tp5441003p5441003.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
"Jean-Yves F. Barbier"
Date:
On Mon, 30 Jan 2012 02:24:08 -0800 (PST)
Windybell <lmhelp1@orange.fr> wrote:

> I am running the Debian Lenny PostgreSQL package (v.8.4).
> When I issue the following command:

I guess the command is: ps axuf|grep postgres

> I am wondering what are these four last processes ("postgres: writer",
> "postgres: wal writer", "postgres: autovacuum launcher" and "postgres: stats
> collector")?

Because, as their name suggest it, they take care of Pg different
parts.

> Their PPID is 3069.

That can't be, each running software/process have a different PID.
This PID Nb is in the 2nd column.

> What is weird to me is the "COMMAND" column as far as these four processes
> are concerned.
> In the "COMMAND "column I would expect a real command, not a description.
> Can you explain?

If you use the command I wrote above, you'll see they all depend on
the main process launch by the script in /etc/init.d.

--
Eat shit -- billions of flies can't be wrong.

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Tom Lane
Date:
"Jean-Yves F. Barbier" <12ukwn@gmail.com> writes:
> On Mon, 30 Jan 2012 02:24:08 -0800 (PST)
> Windybell <lmhelp1@orange.fr> wrote:
>> I am wondering what are these four last processes ("postgres: writer",
>> "postgres: wal writer", "postgres: autovacuum launcher" and "postgres: stats
>> collector")?

> Because, as their name suggest it, they take care of Pg different
> parts.

Right.

>> Their PPID is 3069.

> That can't be, each running software/process have a different PID.
> This PID Nb is in the 2nd column.

He said PPID, that is *parent* process ID, so the above is expected ---
they should all be children of the same postmaster process.

>> What is weird to me is the "COMMAND" column as far as these four processes
>> are concerned.
>> In the "COMMAND "column I would expect a real command, not a description.
>> Can you explain?

We intentionally change the command string reported by ps for each
postmaster child process, so that you can tell the various processes
apart.  If we did not, every postmaster child would show the exact
same command string as the postmaster itself was launched with.
(To get an idea of how useless that is, try looking at "top" sometime
--- on most systems I've worked with, it ignores the changed command
strings, so you can't tell what's what.)

            regards, tom lane

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Windybell
Date:
You don't have to guess, you just have to read well ; the command I issued
is:Thank you for the additional " f " option which is more illustrative.

Again, if you read well, I didn't write "PID" but "PPID". The four processes
have the same PPID.


Jiff wrote
> If you use the command I wrote above, you'll see they all depend on
> the main process launch by the script in /etc/init.d.
It's what I meant to say by writing that the four processes have the same
PPID.
But this sentence of yours helps.
I guess my question wasn't that clear.
I couldn't find a detailled documentation about the PostgreSQL server
architecture.

Best regards.
--
Novice doesn't mean neither stupid nor ignorant but most people confuse the
two.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/PostgreSQL-Debian-Processes-postgres-writer-process-etc-tp5441003p5441900.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Windybell
Date:
@tom lane
Thank you for your explanation. It's much clearer now.

Best regards.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/PostgreSQL-Debian-Processes-postgres-writer-process-etc-tp5441003p5441908.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Windybell
Date:
Still investigating...

--------------------------------------------------------
About the "postgres: autovacuum launcher process"
--------------------------------------------------------
The "postgres: autovacuum launcher process" daemon is running because the
cluster "autovacuum" parameter default value is "on".
Documentation:
http://www.postgresql.org/docs/8.4/static/routine-vacuuming.html
http://www.postgresql.org/docs/8.4/static/runtime-config-autovacuum.html
(If you set this parameter to "false" and restart the server, the daemon
isn't launched anymore).

BR.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/PostgreSQL-Debian-Processes-postgres-writer-process-etc-tp5441003p5447236.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Bruce Momjian
Date:
On Mon, Jan 30, 2012 at 11:05:10AM -0500, Tom Lane wrote:
> >> What is weird to me is the "COMMAND" column as far as these four processes
> >> are concerned.
> >> In the "COMMAND "column I would expect a real command, not a description.
> >> Can you explain?
>
> We intentionally change the command string reported by ps for each
> postmaster child process, so that you can tell the various processes
> apart.  If we did not, every postmaster child would show the exact
> same command string as the postmaster itself was launched with.
> (To get an idea of how useless that is, try looking at "top" sometime
> --- on most systems I've worked with, it ignores the changed command
> strings, so you can't tell what's what.)

I belive the 'c' command in modern versions of top toggles display of
the current command string.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Bruce Momjian
Date:
On Wed, Feb 15, 2012 at 11:47:58AM +1300, Gavin Flower wrote:
> On 15/02/12 06:16, Bruce Momjian wrote:
>
>     On Mon, Jan 30, 2012 at 11:05:10AM -0500, Tom Lane wrote:
>
>                 What is weird to me is the "COMMAND" column as far as these four processes
>                 are concerned.
>                 In the "COMMAND "column I would expect a real command, not a description.
>                 Can you explain?
>
>         We intentionally change the command string reported by ps for each
>         postmaster child process, so that you can tell the various processes
>         apart.  If we did not, every postmaster child would show the exact
>         same command string as the postmaster itself was launched with.
>         (To get an idea of how useless that is, try looking at "top" sometime
>         --- on most systems I've worked with, it ignores the changed command
>         strings, so you can't tell what's what.)
>
>     I belive the 'c' command in modern versions of top toggles display of
>     the current command string.
>
>
> Yes, pressing 'c' when top is running gives a fuller description of the process
> command string, had done in Fedora for longer than I can remember.  So I would
> be surprised if any Linux distribution had not had it for several years.

What is also interesting is that it remembers your previous 'c' mode
when you restart top.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Re: PostgreSQL - Debian - Processes: postgres: writer process, etc.

From
Gavin Flower
Date:
On 15/02/12 06:16, Bruce Momjian wrote:
On Mon, Jan 30, 2012 at 11:05:10AM -0500, Tom Lane wrote:
What is weird to me is the "COMMAND" column as far as these four processes
are concerned.
In the "COMMAND "column I would expect a real command, not a description.
Can you explain?
We intentionally change the command string reported by ps for each
postmaster child process, so that you can tell the various processes
apart.  If we did not, every postmaster child would show the exact
same command string as the postmaster itself was launched with.
(To get an idea of how useless that is, try looking at "top" sometime
--- on most systems I've worked with, it ignores the changed command
strings, so you can't tell what's what.)
I belive the 'c' command in modern versions of top toggles display of
the current command string.

Yes, pressing 'c' when top is running gives a fuller description of the process command string, had done in Fedora for longer than I can remember.  So I would be surprised if any Linux distribution had not had it for several years.

you can also try
ps aux | grep postgres
at the command line prompt

$ ps aux | grep postgres
postgres  1777  0.0  0.8 2352592 66692 ?       S    11:21   0:01 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
postgres  2979  0.0  0.0 181024   952 ?        Ss   11:21   0:00 postgres: logger process                       
postgres  2989  0.0  0.1 2353620 14532 ?       Ss   11:21   0:00 postgres: writer process                       
postgres  2990  0.0  0.0 2353620 1092 ?        Ss   11:21   0:00 postgres: wal writer process                   
postgres  2991  0.0  0.0 2354356 2380 ?        Ss   11:21   0:00 postgres: autovacuum launcher process          
postgres  2992  0.0  0.0 183120  1160 ?        Ss   11:21   0:00 postgres: stats collector process              
gavin     5450  0.0  0.0 109248   848 pts/13   S+   11:45   0:00 grep --color=auto postgres
$