S
S
softshape2015-12-04 13:35:33
PostgreSQL
softshape, 2015-12-04 13:35:33

PostgreSQL pid, how to find it correctly?

The iotop command shows us that the disk is heavily loading the process -
postgres: ::1(59629) COMMIT
On the advice of the documentation www.postgresql.org/docs/9.1/static/monitoring-stat... we make such a request (shows the current executable database requests) -

SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
       pg_stat_get_backend_activity(s.backendid) AS current_query
    FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s;

However, PID 59629 is not in the list that it gives out. How then to understand what exactly the base is doing at a given second (more precisely, even so - how exactly does it load the disk)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
shamyyl, 2015-12-04
@softshape

Look elsewhere:
and then if need be
SELECT pg_cancel_backend(procpid);

K
Kirill, 2015-12-04
@kshvakov

You need pg_stat_kcache ( https://github.com/dalibo/pg_stat_kcache ), it works in tandem with pg_stat_statements ( www.postgresql.org/docs/9.4/static/pgstatstatement... )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question