Right query to get the current number of connections in a PostgreSQL DB

前端 未结 6 1583
暗喜
暗喜 2020-12-12 10:14

Which of the following two is more accurate?

select numbackends from pg_stat_database;

select count(*) from pg_stat_activity;
6条回答
  •  -上瘾入骨i
    2020-12-12 10:45

    Number of TCP connections will help you. Remember that it is not for a particular database

    netstat -a -n | find /c "127.0.0.1:13306"
    

提交回复
热议问题