pgcat icon indicating copy to clipboard operation
pgcat copied to clipboard

Add Client Connection Limits

Open AndrewJackson2020 opened this issue 1 year ago • 1 comments

This PR adds client connection limits to pgcat. This is an important feature because pgcat will start to show undefined behavior once the number of client connections exceeds the number of max file descriptors set at the OS level (1024 by default on most distros). The absence of this feature means that any user that has access to the pgcat instance can essentially DoS the connection pooler by just opening connections until the max file descriptors limit is reached.

Specifically this PR implements client connection limits at the user level and at the pgcat instance level. I am open to separating this into 2 separate PR's (1 for the instance level and one for the user level) but they are highly related sets of functionality and if the system level one were to be merged without the user level one it would mean any one user still has the ability to DoS the connection pooler and deny access to other clients by just maxing out the number of instance level connections.

This solves issue #799.

AndrewJackson2020 avatar Sep 06 '24 19:09 AndrewJackson2020

@drdrsh Thanks for merging #805 , any chance you can take a look at this one as well? This one is similar in that it does not require any changes to the docker environment/CI and has no breaking changes.

AndrewJackson2020 avatar Sep 10 '24 18:09 AndrewJackson2020