How to resolve FATAL: connection limit exceeded for non-superusers

前端 未结 2 747
自闭症患者
自闭症患者 2021-02-13 18:52

I have written a java code for bulk insertion. I\'m using the copy command for importing and creating different connection objects for different tables, but while executing, the

2条回答
  •  野的像风
    2021-02-13 19:26

    You have exceeded the connection limit of PostgreSQL server. There are some reserved connection for Super user.

    To increase the connection limit you have to change the postgresql.conf (default 100) it is located on your PostgreSQL data directory.

    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)
    

    Increase the limit and restart the PostgreSQL instance.

    Warning: increasing the connection limit will affect the memory.

    try optimizing connection using connection pooling either in application or db layer. on PostgreSQL you can use Pgpool2.

提交回复
热议问题