PG中有一张表记录着当前有多少连接

表名:pg_stat_activity

查询当前连接数:

select count(1) from pg_stat_activity;

 

查询最大连接数

show max_connections;

 

最大连接数也可以在pg配置文件中配置:

在postgresql.conf中设置:

max_connections = 500

 

查看为超级用户保留的连接数:

show superuser_reserved_connections ; 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-10
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
相关资源
相似解决方案