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

Multiple Concurrent Updates of Shared Resource Counter

From: Nir Zilberman <nirz(at)checkpoint(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Multiple Concurrent Updates of Shared Resource Counter
Date: 2012-06-07 07:53:48
Message-ID: A305A29309C1274FAA7A0FED4F1F75666EBC3CD433@il-ex01.ad.checkpoint.com (view raw or flat)
Thread:
Lists: pgsql-performance
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.


Responses

pgsql-performance by date

Next:From: Robert KlemmeDate: 2012-06-07 11:48:28
Subject: Re: Multiple Concurrent Updates of Shared Resource Counter
Previous:From: Julien CigarDate: 2012-06-06 12:55:54
Subject: Re: pg 9.1 brings host machine down

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