Re: There are many processes created and died frequently during PostgreSQl idle

From: 高健 <luckyjackgao(at)gmail(dot)com>
To: Jov <amutu(at)amutu(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: There are many processes created and died frequently during PostgreSQl idle
Date: 2013-05-27 01:56:18
Message-ID: CAL454F1SDq_JTHDW-X7NL=2eHbP5-hu2KroQZ0vqDXYVnKqJ6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:
Thanks for Jov's reply.
I traced it again, and found they are really for autovacuum.
I found that
some will call proc_exit() from within AutoVacLauncherMain function,
some will call proc_exit() from within AutoVacWorkerMain function.

But I wonder why not using only a few daemon , instead of making those
processes be short life.

2013/5/24 Jov <amutu(at)amutu(dot)com>

> the process you see may be autovacuum worker process,you can tune the log_autovacuum_min_duration
> to log the autovacuum activities and check if the pids match
> http://www.postgresql.org/docs/9.2/static/runtime-config-autovacuum.html
>
>
> 2013/5/24 高健 <luckyjackgao(at)gmail(dot)com>
>
>> Hello all:
>>
>> I found that during postgresql running, there are so many processes
>> being created and then died.
>> I am interested in the reason.
>>
>> Here is the detail:
>> I installed from postgresql-9.2.1.tar.bz2.
>> I put some debug code in fd.c 's PathNameOpenFile function:
>>
>> fprintf(stderr,"+++While Calling PathNameOpenFile pid=%d.....",getpid();
>> fprintf(stderr,"VfdCache Address is: %p \n\n",VfdCache);
>>
>> When it run, I open two termianal using psql(pid=22109 and pid=22114),
>> then I can got information like this:
>> [postgres(at)lex pgsql]$ ./bin/pg_ctl -D ./data start
>> server starting
>> [postgres(at)lex pgsql]$ LOG: database system was shut down at 2013-05-24
>> 09:28:59 CST
>> LOG: autovacuum launcher started
>> +++While Calling PathNameOpenFile pid=22106.....VfdCache Address is:
>> 0xbfb3320
>>
>> LOG: database system is ready to accept connections
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22109.....VfdCache Address is:
>> 0xbfb2de0
>>
>> +++While Calling PathNameOpenFile pid=22114.....VfdCache Address is:
>> 0xbfba400
>>
>> +++While Calling PathNameOpenFile pid=22114.....VfdCache Address is:
>> 0xbfba400
>>
>> +++While Calling PathNameOpenFile pid=22114.....VfdCache Address is:
>> 0xbfba400
>>
>> +++While Calling PathNameOpenFile pid=22114.....VfdCache Address is:
>> 0xbfba400
>>
>> +++While Calling PathNameOpenFile pid=22120.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22120.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22120.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22127.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22127.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22127.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22134.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22134.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22134.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22142.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22142.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22142.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22149.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22149.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22149.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22156.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22156.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22156.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22165.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22165.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22165.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22171.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22171.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22171.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22178.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22178.....VfdCache Address is:
>> 0xbfe6700
>>
>> +++While Calling PathNameOpenFile pid=22178.....VfdCache Address is:
>> 0xbfe6700
>>
>>
>> But when I grep process information using ps command, I can't find
>> process such like 22120,22127,22134,22142,22149,22156,22178.
>> And the output is growing longer and longer...
>>
>> [root(at)lex ~]# ps -ef | grep post
>> root 4641 4621 0 08:28 pts/3 00:00:00 su - postgres
>> postgres 4642 4641 0 08:28 pts/3 00:00:00 -bash
>> root 4709 4688 0 08:28 pts/4 00:00:00 su - postgres
>> postgres 4710 4709 0 08:28 pts/4 00:00:00 -bash
>> root 4772 4751 0 08:29 pts/5 00:00:00 su - postgres
>> postgres 4773 4772 0 08:29 pts/5 00:00:00 -bash
>> postgres 22101 1 0 09:45 pts/3 00:00:00
>> /usr/local/pgsql/bin/postgres -D ./data
>> postgres 22103 22101 0 09:45 ? 00:00:00 postgres: checkpointer
>> process
>> postgres 22104 22101 0 09:45 ? 00:00:00 postgres: writer process
>>
>> postgres 22105 22101 0 09:45 ? 00:00:00 postgres: wal writer
>> process
>> postgres 22106 22101 0 09:45 ? 00:00:00 postgres: autovacuum
>> launcher process
>> postgres 22107 22101 0 09:45 ? 00:00:00 postgres: stats collector
>> process
>> postgres 22108 4710 0 09:45 pts/4 00:00:00 ./psql
>> postgres 22109 22101 0 09:45 ? 00:00:00 postgres: postgres
>> postgres [local] idle
>> postgres 22113 4773 0 09:46 pts/5 00:00:00 ./psql
>> postgres 22114 22101 0 09:46 ? 00:00:00 postgres: postgres
>> postgres [local] idle
>> root 22187 6429 0 09:55 pts/6 00:00:00 grep post
>> [root(at)lex ~]#
>>
>> So I think that some process is created and then quickly died . But would
>> somebody can kindly say what are the purpose of those process?
>> How about using one worker process and keep it be alive?
>>
>
>
>
> --
> Jov
> blog: http:amutu.com/blog <http://amutu.com/blog>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amit Langote 2013-05-27 02:22:36 Re: There are many processes created and died frequently during PostgreSQl idle
Previous Message Amit Langote 2013-05-26 11:39:55 Re: pg_receivexlog 9.2 client working with 9.1 server?