Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] TODO Done. Superuser backend slot reservations

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>,pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] TODO Done. Superuser backend slot reservations
Date: 2002-08-26 16:16:32
Message-ID: 200208261616.g7QGGWm11376@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> "Nigel J. Andrews" <nandrews(at)investsystems(dot)co(dot)uk> writes:
> > I was taking the line that the last slots in the array are
> > reserved. Those are not going to be taken by non su connections.
> 
> But that doesn't do the job, does it?  My view of the feature is that
> when there are at least MaxBackends - ReservedBackends slots in use (by
> either su or non-su connections) then no new non-su jobs should be let
> in.  For example, if the system is full (with a mix of su and non-su
> jobs) and one non-su job quits, don't we want to hold that slot for a
> possible su connection?
> 
> Your approach does have the advantage of being very cheap to test
> (I think my semantics would require counting the active backends),
> but I'm not sure that it really does what we want.

Tom is right.  If the last two slots are held by two long-running
super-user backends, and the slots fill, there will be no reserved
slots. The trick is that when the maximum number of backends is almost
exceeded, only let the supuer-user in.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Chris HumphriesDate: 2002-08-26 16:25:35
Subject: Re: @(#)Mordred Labs advisory 0x0007: Remove DoS in PostgreSQL
Previous:From: Þórhallur HálfdánarsonDate: 2002-08-26 15:42:12
Subject: Re: @(#)Mordred Labs advisory 0x0007: Remove DoS in PostgreSQL

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-08-26 16:17:58
Subject: Re: pg_locks cleanup
Previous:From: Gerhard HintermayerDate: 2002-08-26 14:42:56
Subject: Re: libpgtcl modifications

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group