Linux: searching for the sender of the postgres process inaction

In fact, I am running a program of four demons. This makes the postgres connection, and it disconnects once with the products. But when I put ps aux, there are a lot of idle postgres processes running on my system. I just want to know the initiator of each idle postres process. So, I was able to find out which process is not closing the postgres connection properly.

Thanks at Advance.

+3
source share
3 answers

Use the following command

netstat -ntp

It will show the process ID and process name of the creator of the postgres connector.

+4
source

postgresql 9.0, " " , , . (Perl):

$dbh = DBI->connect("dbi:Pg:application_name=test/$$", undef, undef)

, , .

TCP/IP, pg_stat_activity , lsof ( netstat -p), .

+2
0

Source: https://habr.com/ru/post/1777646/


All Articles