5

I have set max_connection = 2000 into my postgresql.conf file. However, I have 10 databases on this server and each one of them is using a few number of connections from available connection. I need to limit number of connection for each one of them. For example, for abc database , I want , it should use only 100 connections,not more than that. Is there any way to limit number of connection for each database on a particular server for postgres. Any immediate response will be appreciated.

-Thanks,

1 Answer 1

7

You can set connection limit per database by running an ALTER command on the database and setting CONNECTION LIMIT, like this:

ALTER DATABASE your_db_name CONNECTION LIMIT 100;

For more information have a look here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.