There are many processes created and died frequently during PostgreSQl idle

From: 高健 <luckyjackgao(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: There are many processes created and died frequently during PostgreSQl idle
Date: 2013-05-24 02:50:45
Message-ID: CAL454F2_t7fgKqWWY7d6NEHo2xv6PvD7kGSk3Ve_9-g9XGvRCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2013-05-24 02:57:14 Re: Success stories of PostgreSQL implementations in different companies
Previous Message Scott Marlowe 2013-05-24 01:29:02 Re: New role, no database