non-superuser reserved connections? connection pools?

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: non-superuser reserved connections? connection pools?
Date: 2011-07-03 22:01:23
Message-ID: B9359B26-A9B2-4AE9-81E6-74DE09B16043@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It would be nice to be able to set aside a few connections for non-superusers, such as stats-monitoring connections. There's often no reason to grant these users superuser privileges (they're just observers, and security-definer functions can make anything visible that they may need)), but at the same time you want them to be able to connect even when the "normal" pool of slots may be full.

I googled a bit, assuming there had been discussion of something similar in the past, but didn't find anything.

I'm not sure what configuration would look like. Perhaps there's a generalized "connection pool" concept that's missing, extending the current "superuser" connection pool specified by the superuser_reserved_connections GUC something like:

CREATE CONNECTION POOL stats WITH LIMIT 10; -- 40 connections allotted for the foo connection pool.
ALTER ROLE nagios WITH CONNECTION POOL foo; -- the nagios role is allowed to take a connection from the foo connection pool.

Right now, of course, connection limits are set in postgresql.conf and only alterable on restart, so perhaps there could be a connection_pools GUC, something along the lines of:

connection_pools={stats=3,superuser=10}
max_connections=100

The connections allotted to "superuser" would have the same meaning as the current superuser_reserved_connections GUC.

Does this seem to be a useful feature to anyone else?

Michael Glaesemann
grzm seespotcode net

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-07-03 23:05:44 Re: plpgsql extension install nitpick
Previous Message Michael Gould 2011-07-03 21:55:22 Re: Full GUID support