Обсуждение: Why i see several postgres server processes sometimes ?

Поиск
Список
Период
Сортировка

Why i see several postgres server processes sometimes ?

От
Georgi Ivanov
Дата:
Hi,
I wander why i see several postgres server processes with different PIDs
I don't mean those normal query processes. I see several of these:
/usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 
With different pids. Is this normal ?


  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                       
27662 postgres  20   0 1623m  14m  10m R    5  0.3   0:00.14 postgres: wmg wmg 172.18.9.21(43725) idle                                                                                                                                     
15489 postgres  20   0 1610m  33m  33m S    3  0.7  76:51.46 /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 
27714 postgres  20   0 1613m 7720 5228 S    1  0.2   0:00.03 postgres: wmg wmg 172.18.9.12(42434) idle                                                                                                                                     
27730 postgres  20   0 1611m 2336 1228 R    1  0.0   0:00.02 /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 
27731 postgres  20   0 1610m 1572 1044 R    1  0.0   0:00.02 /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 
15494 postgres  20   0 1611m 1.5g 1.5g S    0 30.6   6:10.54 postgres: writer process                                                                                                                                                      
27711 postgres  20   0 1613m 7752 5248 S    0  0.2   0:00.01 postgres: wmg wmg 172.18.9.13(53169) idle                                                                                                                                     
27729 postgres  20   0 1610m 1572 1044 R    0  0.0   0:00.01 /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 
15495 postgres  20   0 1611m 1020  652 S    0  0.0   0:23.09 postgres: wal writer process                                                                                                                                                  
15496 postgres  20   0 1612m 1648  564 S    0  0.0   0:24.77 postgres: autovacuum launcher process                                                                                                                                         
15497 postgres  20   0 73524 1308  296 S    0  0.0  18:29.63 postgres: stats collector process                                                                                                                                             
17480 postgres  20   0 37052  940  936 S    0  0.0   0:00.01 su postgres                                                                                                                                                                   
17481 postgres  20   0 19384 1236 1232 S    0  0.0   0:00.01 bash                                                                                                                                                                          
17510 postgres  20   0 67696 2400 1992 S    0  0.0   0:00.12 /usr/lib/postgresql/8.4/bin/psql wmg                                                                                                                                          
17537 postgres  20   0 1617m  26m  21m S    0  0.5   0:00.12 postgres: postgres wmg [local] idle                                                                                                                                           
27722 postgres  20   0 1614m  10m 7372 R    0  0.2   0:00.00 postgres: wmg wmg 172.18.9.13(53195) idle                                                                                                                                     
27724 postgres  20   0 1613m 7700 5208 R    0  0.2   0:00.00 postgres: wmg wmg 172.18.9.12(42452) PARSE                                                                                                                                    
27727 postgres  20   0 1613m 4324 2336 R    0  0.1   0:00.00 postgres: wmg wmg 172.18.9.13(53204) startup                                                                                                                                  
27732 postgres  20   0 1610m  424    0 R    0  0.0   0:00.00 /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 
27733 postgres  20   0 1610m  424    0 R    0  0.0   0:00.00 /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf                                                 



Re: Why i see several postgres server processes sometimes ?

От
Peter Geoghegan
Дата:
On 6 October 2010 15:44, Georgi Ivanov <georgi.r.ivanov@gmail.com> wrote:
> Hi,
> I wander why i see several postgres server processes with different PIDs
> I don't mean those normal query processes. I see several of these:
> /usr/lib/postgresql/8.4/bin/postgres -D /database/postgresql/8.4/main -c
> config_file=/etc/postgresql/8.4/main/postgresql.conf
> With different pids. Is this normal ?
>

This is normal. Postgres is said to have a multi-process architecture
(which is often contrasted with a multi threaded architecture). The
number of processes isn't very predictable.


--
Regards,
Peter Geoghegan

Re: Why i see several postgres server processes sometimes ?

От
"Massa, Harald Armin"
Дата:
Peter,
 
This is normal. Postgres is said to have a multi-process architecture
(which is often contrasted with a multi threaded architecture). The
number of processes isn't very predictable.

you are right, it is normal.

But the number of processes is quite predictable: 

on default PostgreSQL starts up with 5 processes:

one background-writer
one postmaster who masters the startup of additional progresses
one autovacuum-daemon
two processes which I have not leveled up enough to know what they are doing
 
And then there is one additional process for every client connection. 

Harald

--
GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607

Amtsgericht Stuttgart, HRB 734971
-
persuadere.
et programmare

Re: Why i see several postgres server processes sometimes ?

От
Raymond O'Donnell
Дата:
On 06/10/2010 18:53, Massa, Harald Armin wrote:
> Peter,
>
>     This is normal. Postgres is said to have a multi-process architecture
>     (which is often contrasted with a multi threaded architecture). The
>     number of processes isn't very predictable.
>
> you are right, it is normal.
>
> But the number of processes is quite predictable:
>
> on default PostgreSQL starts up with 5 processes:
>
> one background-writer
> one postmaster who masters the startup of additional progresses
> one autovacuum-daemon
> two processes which I have not leveled up enough to know what they are doing
> And then there is one additional process for every client connection.

So that's where the extra processes are coming from - something is
holding connections open.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie