Re: refusing connections based on load ...

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refusing connections based on load ...
Date: 2001-04-25 19:03:10
Message-ID: Pine.BSF.4.33.0104251555240.4451-100000@mobile.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 25 Apr 2001, Peter Eisentraut wrote:

> Tom Lane writes:
>
> > A conncurrent-xacts limit isn't perfect of course, but I think it'd
> > be pretty good, and certainly better than anything based on the
> > available load-average numbers.
>
> The concurrent transaction limit would allow you to control the absolute
> load of the PostgreSQL server, but we can already do that and it's not
> what we're after here. The idea behind the load average based approach is
> to make the postmaster respect the situation of the overall system.
> Additionally, the concurrent transaction limit would only be useful on
> setups that have a lot of idle transactions. Those setups exist, but not
> everywhere.
>
> To me, both of these approaches are in the "if you don't like it, don't
> use it" category.

Agreed ... by default, the loadavg method could be set to zero, to ignore
... I don't care if I'm off by 1min before I catch the increase, the fact
is that I have caught it, and prevent any new ones coming in until it
drops off again ...

Make it two variables:

transla
rejectla

if transla is hit, restrict on transactions, letting others connect, but
putting them on hold while the la drops again ... if it goes above
rejectla, refuse new connections altogether ...

so now I can set something like:

transla = 8
rejectla = 16

but if loadavg goes above 16, I want to get rid of what is causing the
load to rise *before* adding new variables to the mix that will cause it
to rise higher ...

and your arg about permissions (Tom's, not Peter's) is moot in at least 3
of the major systems (Linux, *BSD and Solaris) as there is a getloadavg()
function in all three for doing this ...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-04-25 19:25:34 Re: refusing connections based on load ...
Previous Message Peter Eisentraut 2001-04-25 18:28:18 Re: refusing connections based on load ...