From: | Petr Jelínek <pjmodos(at)parba(dot)cz> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | limiting connections per user/database |
Date: | 2005-06-25 21:02:32 |
Message-ID: | 42BDC668.1060900@parba.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Hello,
patch I attached allows to set connectin limits per user or per database
(it's on TODO list).
It's proposal because I am not sure if this implementation can be
accepted (I never made new feature patch for postgres so I really dunno)
and I would like to know what you guys think about it and what I should
change.
Something about patch:
I added two new guc variables name max_db_connections and
max_user_connections which can be set by superuser which means it can be
in main config file or in user/database config.
I was thinking about 3 different aproaches - the other two was using
max_connections with set/get hooks or change in catalog tables but new
fuc variables seemed best solution to me.
Conenction limits are checked in InitPostgres function after user and
database configs are loaded.
Patch works only when stats are on because it takes number of
connections per user and database from there - I had to patch pgstat to
store user connection stats.
Also this patch relies on bugfix I sent on Thursday but I wasn't
subcribed and it still waits for moderation so I attached it to this
mail too (pgstat.c.diff) because without it database stats are broken in
current CVS.
I modified only .c sources, no documentation, I will make documentation
changes when (and if) this will be finished and accepted.
Diffs should be against latest CVS.
--
Regards
Petr Jelinek (PJMODOS)
Attachment | Content-Type | Size |
---|---|---|
pgstat.c.diff | text/plain | 2.2 KB |
connlimit.diff | text/plain | 20.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2005-06-25 21:19:25 | Re: limiting connections per user/database |
Previous Message | Andrew Dunstan | 2005-06-25 20:46:43 | Re: COPY FROM performance improvements |