Error: sorry, too many clients already

后端 未结 2 1016
执念已碎
执念已碎 2021-01-15 15:12

I am using PostgreSQL in my NodeJS backend service. All of sudden, when I start the service I am facing below error

 connection error error: sorry, too many         


        
2条回答
  •  深忆病人
    2021-01-15 15:43

    below query will help you.

    select max_conn,used,res_for_super,max_conn-used-res_for_super res_for_normal 
    from 
      (select count(*) used from pg_stat_activity) t1,
      (select setting::int res_for_super from pg_settings where name=$$superuser_reserved_connections$$) t2,
      (select setting::int max_conn from pg_settings where name=$$max_connections$$) t3
    

提交回复
热议问题