gpt4 book ai didi

java - 如何解决 FATAL : connection limit exceeded for non-superusers

转载 作者:搜寻专家 更新时间:2023-10-30 21:05:22 24 4
gpt4 key购买 nike

我已经编写了用于批量插入的 Java 代码。我正在使用复制命令为不同的表导入和创建不同的连接对象,但在执行时,程序会抛出以下错误:

FATAL: connection limit exceeded for non-superusers

最佳答案

您已超出 PostgreSQL 服务器的连接限制。有一些为 super 用户保留的连接。

要增加连接限制,您必须更改 postgresql.conf(默认 100)它位于您的 PostgreSQL 数据目录中。

cat postgresql.conf | grep max_connection max_connections = 100
# (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# max_locks_per_transaction * (max_connections + max_prepared_transactions)

增加限制并重启 PostgreSQL 实例。

警告:增加连接限制会影响内存。

尝试在应用层或数据库层使用连接池优化连接。在 PostgreSQL 上你可以使用 Pgpool2 .

关于java - 如何解决 FATAL : connection limit exceeded for non-superusers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13581901/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com