From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Alan Stange <stange@rentec.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: limit number of concurrent callers to a stored proc?
Date: Thu, 18 Aug 2005 10:36:07 +0800
Message-ID: <4303F417.3090307@familyhealth.com.au> (raw)
In-Reply-To: <4303E704.4030200@rentec.com>
References: <4303E704.4030200@rentec.com>
You could use a 1 column/1 row table perhaps. Use some sort of locking
mechanism.
Also, check out contrib/userlock
Chris
Alan Stange wrote:
> Hello all,
>
> is there a simple way to limit the number of concurrent callers to a
> stored proc?
>
> The problem we have is about 50 clients come and perform the same
> operation at nearly the same time. Typically, this query takes a few
> seconds to run, but in the case of this thundering herd the query time
> drops to 70 seconds or much more. The query can return up to 15MB of data.
>
> The machine is a dual opteron, 8 GB memory, lots of fiber channel disk,
> Linux 2.6, etc.
>
> So, I'm thinking that a semaphore than will block more than N clients
> from being in the core of the function at one time would be a good thing.
> Thanks!
>
> -- Alan
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: chriskl@familyhealth.com.au, stange@rentec.com
Subject: Re: limit number of concurrent callers to a stored proc?
In-Reply-To: <4303F417.3090307@familyhealth.com.au>
References: <4303E704.4030200@rentec.com> <4303F417.3090307@familyhealth.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox