Limiting concurrent connections to a PostgreSQL server can be used to reduce the risk of Denial of Service (DoS) attacks. Rationale: Limiting the number of concurrent sessions at the user level helps to reduce the risk of DoS attacks.
Solution
Set a per-user connection limit by running: ALTER USER <dbuser> CONNECTION LIMIT <reasonable concurrent connection count>; Default Value: -1