Re: Looking for software to 'enqueue' connections - Mailing list pgsql-general

From John R Pierce
Subject Re: Looking for software to 'enqueue' connections
Date
Msg-id 18ca4acb-59ee-1cd8-9c64-bdb11b6df1fe@hogranch.com
Whole thread Raw
In response to Looking for software to 'enqueue' connections  (Edmundo Robles <edmundo@sw-argos.com>)
List pgsql-general
On 8/15/2016 1:30 PM, Edmundo Robles wrote:
> I want find  a software to 'enqueue' the client connections to
> database, so if i reach the max limit the query must be holding in a
> queue   until one connection is released.
>

pgbouncer is the correct answer, you may need to play about with the
configuration a bit.   there's a few modes that might work, ideally,
write your apps to connect to postgres, do a transaction, and
disconnect, and limit the pool size so only so many connections can be
active at a time.    the other mode is to allow the clients to stay
connected to the pool, but have a limited number of actual database
connections that you allocate on a transaction basis.

> I have  many devices (100+) saving  their state to a database,  each
> minute,  but  the table is too large more than 13,000,000 of records
> and many indexes, so, insert  one record takes 3 or more minutes.

that sounds terrible.   single row inserts shouldn't *ever* take 3
minutes, if you have clients inserting a row a minute.   you may need
faster disk storage, you may need to improve postgres tuning.

'many indexes' ?  how many ?  too many indexes would definitely slow
inserts down.


--
john r pierce, recycling bits in santa cruz



pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: 9.2 to 9.5 pg_upgrade losing data
Next
From: Adrian Klaver
Date:
Subject: Re: Looking for software to 'enqueue' connections