From: Nir Zilberman <nirz@checkpoint.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Multiple Concurrent Updates of Shared Resource Counter
Date: Thu, 7 Jun 2012 10:53:48 +0300
Message-ID: <A305A29309C1274FAA7A0FED4F1F75666EBC3CD433@il-ex01.ad.checkpoint.com> (raw)
Hi.
We are handling multiple concurrent clients connecting to our system - trying to get a license seat (each license has an initial capacity of seats).
We have a table which keeps count of the acquired seats for each license.
When a client tries to acquire a seat we first make sure that the number of acquired seats is less than the license capacity.
We then increase the number of acquired seats by 1.
Our main problem here is with the acquired seats table.
It is actually a shared resource which needs to be updated concurrently by multiple transactions.
When multiple transactions are running concurrently - each transaction takes a long time to complete because it waits on the lock for the shared resource table.
Any suggestions for better implementation/design of this feature would be much appreciated.
Regards,
Nir.
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: nirz@checkpoint.com
Subject: Re: Multiple Concurrent Updates of Shared Resource Counter
In-Reply-To: <A305A29309C1274FAA7A0FED4F1F75666EBC3CD433@il-ex01.ad.checkpoint.com>
References: <A305A29309C1274FAA7A0FED4F1F75666EBC3CD433@il-ex01.ad.checkpoint.com>
* 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