Thread: Postgres process

Postgres process

From
iliya g
Date:
Hi guys,

I need some help discovering the processes that run on an instance. I know that there are many processes running on one instance and they are all called postges, but I was hoping you can help me find a way to uniquely identify each one of them. I want to discover what the process name is and what the does. Let me know if you have any suggestions.

Thanks.

Re: Postgres process

From
Raghavendra
Date:
Hi,

I need some help discovering the processes that run on an instance. I know that there are many processes running on one instance and they are all called postges, but I was hoping you can help me find a way to uniquely identify each one of them. I want to discover what the process name is and what the does. Let me know if you have any suggestions.

As you know, there are set of Mandatory process starts along with instance and others  'one-user-per-connection' basis called 'postgres' process (also called as 'Server Process' or 'User Process').

eg:- 
-bash-4.1$ ps -ef | grep postgres
postgres 19294     1  0 01:13 ?        00:00:04 /opt/PostgreSQL/9.0/bin/postgres -D data
postgres 19295 19294  0 01:13 ?        00:00:00 postgres: logger process
postgres 19297 19294  0 01:13 ?        00:00:00 postgres: writer process
postgres 19298 19294  0 01:13 ?        00:00:00 postgres: wal writer process
postgres 19299 19294  0 01:13 ?        00:00:01 postgres: autovacuum launcher process
postgres 19301 19294  0 01:13 ?        00:00:02 postgres: stats collector process
postgres 27176 19294  1 09:25 ?        00:00:01 postgres: postgres postgres [local] SELECT

In the above example, you can see both mandatory process and user-process performing 'SELECT' operation.
To identify postgres process uniquely, you can get it from catalog view 'pg_stat_activity'.

---
Regards,
Raghavendra
EnterpriseDB Corporation

 
Thanks.

Re: Postgres process

From
iliya g
Date:

Thanks, Raghavendra.

The problem is that when I run ps - ef l grep postgres, I only get postgres and not the process description. I can't see what kind of process it is and if it is a logger process or writer or stats collector. I get this at he end:
......./pgsql/bin/postgres




Sent from Yahoo! Mail on Android



From: Raghavendra <raghavendra.rao@enterprisedb.com>;
To: iliya g <gyozov2004@yahoo.com>;
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>;
Subject: Re: [ADMIN] Postgres process
Sent: Tue, Aug 9, 2011 11:05:29 AM

Hi,

I need some help discovering the processes that run on an instance. I know that there are many processes running on one instance and they are all called postges, but I was hoping you can help me find a way to uniquely identify each one of them. I want to discover what the process name is and what the does. Let me know if you have any suggestions.

As you know, there are set of Mandatory process starts along with instance and others  'one-user-per-connection' basis called 'postgres' process (also called as 'Server Process' or 'User Process').

eg:- 
-bash-4.1$ ps -ef | grep postgres
postgres 19294     1  0 01:13 ?        00:00:04 /opt/PostgreSQL/9.0/bin/postgres -D data
postgres 19295 19294  0 01:13 ?        00:00:00 postgres: logger process
postgres 19297 19294  0 01:13 ?        00:00:00 postgres: writer process
postgres 19298 19294  0 01:13 ?        00:00:00 postgres: wal writer process
postgres 19299 19294  0 01:13 ?        00:00:01 postgres: autovacuum launcher process
postgres 19301 19294  0 01:13 ?        00:00:02 postgres: stats collector process
postgres 27176 19294  1 09:25 ?        00:00:01 postgres: postgres postgres [local] SELECT

In the above example, you can see both mandatory process and user-process performing 'SELECT' operation.
To identify postgres process uniquely, you can get it from catalog view 'pg_stat_activity'.

---
Regards,
Raghavendra
EnterpriseDB Corporation

 
Thanks.

Re: Postgres process

From
Raghavendra
Date:
Only active 'postgres' process you can see with description, rest will be in 'IDLE'.
Moreover, which operating system you are in..

--Raghav

On Tue, Aug 9, 2011 at 7:54 PM, iliya g <gyozov2004@yahoo.com> wrote:

Thanks, Raghavendra.

The problem is that when I run ps - ef l grep postgres, I only get postgres and not the process description. I can't see what kind of process it is and if it is a logger process or writer or stats collector. I get this at he end:
......./pgsql/bin/postgres




Sent from Yahoo! Mail on Android



From: Raghavendra <raghavendra.rao@enterprisedb.com>;
To: iliya g <gyozov2004@yahoo.com>;
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>;
Subject: Re: [ADMIN] Postgres process
Sent: Tue, Aug 9, 2011 11:05:29 AM

Hi,

I need some help discovering the processes that run on an instance. I know that there are many processes running on one instance and they are all called postges, but I was hoping you can help me find a way to uniquely identify each one of them. I want to discover what the process name is and what the does. Let me know if you have any suggestions.

As you know, there are set of Mandatory process starts along with instance and others  'one-user-per-connection' basis called 'postgres' process (also called as 'Server Process' or 'User Process').

eg:- 
-bash-4.1$ ps -ef | grep postgres
postgres 19294     1  0 01:13 ?        00:00:04 /opt/PostgreSQL/9.0/bin/postgres -D data
postgres 19295 19294  0 01:13 ?        00:00:00 postgres: logger process
postgres 19297 19294  0 01:13 ?        00:00:00 postgres: writer process
postgres 19298 19294  0 01:13 ?        00:00:00 postgres: wal writer process
postgres 19299 19294  0 01:13 ?        00:00:01 postgres: autovacuum launcher process
postgres 19301 19294  0 01:13 ?        00:00:02 postgres: stats collector process
postgres 27176 19294  1 09:25 ?        00:00:01 postgres: postgres postgres [local] SELECT

In the above example, you can see both mandatory process and user-process performing 'SELECT' operation.
To identify postgres process uniquely, you can get it from catalog view 'pg_stat_activity'.

---
Regards,
Raghavendra
EnterpriseDB Corporation

 
Thanks.


Re: Postgres process

From
"Kevin Grittner"
Date:
iliya g <gyozov2004@yahoo.com> wrote:

> The problem is that when I run ps - ef l grep postgres, I only get
> postgres and not the process description.

It's hard to know what advice to give without more information.
Could you post the output of the query shown on this page?:

http://wiki.postgresql.org/wiki/Server_Configuration

-Kevin

Re: Postgres process

From
Raghavendra
Date:
I go with Kevin. 
Still, my guess we cannot get the process description on SunOS.

--Raghav

On Tue, Aug 9, 2011 at 8:18 PM, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
iliya g <gyozov2004@yahoo.com> wrote:

> The problem is that when I run ps - ef l grep postgres, I only get
> postgres and not the process description.

It's hard to know what advice to give without more information.
Could you post the output of the query shown on this page?:

http://wiki.postgresql.org/wiki/Server_Configuration

-Kevin

Re: Postgres process

From
Tom Lane
Date:
Raghavendra <raghavendra.rao@enterprisedb.com> writes:
> Still, my guess we cannot get the process description on SunOS.

I surely hope you're not still running SunOS.  If you mean Solaris,
note what the manual says at
http://www.postgresql.org/docs/9.0/static/monitoring-ps.html

    Tip: Solaris requires special handling. You must use /usr/ucb/ps,
    rather than /bin/ps. You also must use two w flags, not just one. In
    addition, your original invocation of the postgres command must have
    a shorter ps status display than that provided by each server
    process. If you fail to do all three things, the ps output for each
    server process will be the original postgres command line.

This advice is close to ten years old, but might well still apply to
recent Solaris releases.

            regards, tom lane

Re: Postgres process

From
Raghavendra
Date:
Ahh,,, I missed this.. :)

Thank you Tom for pointing to appropriate direction. Below command worked

/usr/ucb/ps -ww <PID>

--Raghav

On Tue, Aug 9, 2011 at 9:15 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Raghavendra <raghavendra.rao@enterprisedb.com> writes:
> Still, my guess we cannot get the process description on SunOS.

I surely hope you're not still running SunOS.  If you mean Solaris,
note what the manual says at
http://www.postgresql.org/docs/9.0/static/monitoring-ps.html

   Tip: Solaris requires special handling. You must use /usr/ucb/ps,
   rather than /bin/ps. You also must use two w flags, not just one. In
   addition, your original invocation of the postgres command must have
   a shorter ps status display than that provided by each server
   process. If you fail to do all three things, the ps output for each
   server process will be the original postgres command line.

This advice is close to ten years old, but might well still apply to
recent Solaris releases.

                       regards, tom lane

Re: Postgres process

From
iliya g
Date:

Thanks, Tom. Let me look into this.


Sent from Yahoo! Mail on Android



From: Tom Lane <tgl@sss.pgh.pa.us>;
To: Raghavendra <raghavendra.rao@enterprisedb.com>;
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; iliya g <gyozov2004@yahoo.com>; pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>;
Subject: Re: [ADMIN] Postgres process
Sent: Tue, Aug 9, 2011 3:45:11 PM

Raghavendra <raghavendra.rao@enterprisedb.com> writes:
> Still, my guess we cannot get the process description on SunOS.

I surely hope you're not still running SunOS.  If you mean Solaris,
note what the manual says at
http://www.postgresql.org/docs/9.0/static/monitoring-ps.html

    Tip: Solaris requires special handling. You must use /usr/ucb/ps,
    rather than /bin/ps. You also must use two w flags, not just one. In
    addition, your original invocation of the postgres command must have
    a shorter ps status display than that provided by each server
    process. If you fail to do all three things, the ps output for each
    server process will be the original postgres command line.

This advice is close to ten years old, but might well still apply to
recent Solaris releases.

            regards, tom lane

Re: Postgres process

From
Craig Ringer
Date:
On 9/08/2011 11:26 AM, iliya g wrote:
> Hi guys,
>
> I need some help discovering the processes that run on an instance. I
> know that there are many processes running on one instance and they are
> all called postges, but I was hoping you can help me find a way to
> uniquely identify each one of them. I want to discover what the process
> name is and what the does. Let me know if you have any suggestions.

On operating systems that support it, postgresql changes the process
name to tell you what it's doing.

On other operating systems, use the pg_stat_activity view. See the manual.

If you still need more information, please read this so you provide
enough detail to get a proper answer before following up:

   http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

... since you didn't even mention what operating system you were running
on in your question!

--
Craig Ringer