【问题标题】:Postgresql too many clients error on linux serverlinux服务器上的postgresql太多客户端错误
【发布时间】:2013-05-24 21:00:51
【问题描述】:

当我尝试在 linux 上连接 postgresql 9.0 服务器时,我已经连接了太多客户端。我尝试将max_connections 从 100 增加到 200 并启动它不占用最大连接数的服务器。我应该在 linux 服务器上更改什么

Eclipse LogCat

Caused by: org.postgresql.util.PSQLException: FATAL: sorry, too many clients already
       at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
       at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
       at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
       at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
       at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
       at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)

【问题讨论】:

    标签: database postgresql


    【解决方案1】:

    增加 ma​​x_connections 并保持该值的唯一方法是修改 postgresql.conf 文件,因此首先检查该值是否已更改(重启后服务器):

    show max_connections
    

    如果值没有改变,那么你的程序有问题(可能是文件权限?)。如果值 DID 发生变化,您可能会尝试使用更高的值(很奇怪,但可能取决于您的应用程序连接要求,或者连接泄漏)。

    【讨论】:

      【解决方案2】:

      这是一个常见问题解答,在 PostgreSQL wiki 上的 Number of Database Connections 中进行了讨论。

      【讨论】:

        猜你喜欢
        • 2021-06-09
        • 1970-01-01
        • 1970-01-01
        • 2020-10-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-10-04
        相关资源
        最近更新 更多