I am locking down a Postgres 12 instance and can't find clear explanation of connection limits and rolconnlimit settings. First I have max_connection set to 100 but noticed that superuser_reserved_connections is set to 3. Does that mean that I have 97 connections effectively? That is not really an issue but I was curious.
The real stumper is how I set the role connection limits? Right now they are all -1(unlimited) but my guidance is that they must be set. Should I set a limit on connections for "postgres" and the other default roles such as pg_monitor, pg_read_all_stats, etc? If I do set them should they be set to something lower that max_connections? This database only has one user, which is an application account so I am assuming setting that to 100 will not be an issue?
1 Answer
... max_connection set to 100 ... superuser_reserved_connections is set to 3. Does that mean that I have 97 connections effectively?
Short answer: Yes.
... role connection limits? Right now they are all -1 (unlimited) but my guidance is that they must be set.
"Guidance" from whom, exactly?
If someone is telling you that you must do something, then you would hope that they have at least some idea of how to do so and should be able to tell you this.
Of course, the first thing to do is to lock down your Test Postgres 12 instance and see what breaks. Making changes like this directly in Production would be madness.
- Sorry a little late getting back; but your answer helped. As far as the Guidance comment; not everybody telling you to do something necessarily knows anything about it; they just know there is a checklist to follow and it should be followed. So in that case I need to make sure these settings don't break the system and explain when a setting or configuration should be not implemented. That is why I depend on the expertise on this board and appreciative help such as yours. And your last point can't be understated; I like my job so I test test test.user1548815– user15488152021-09-12 02:35:21 +00:00Commented Sep 12, 2021 at 2:35