Re: Looking for software to 'enqueue' connections

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for software to 'enqueue' connections
Date: 2016-08-15 20:43:40
Message-ID: 18ca4acb-59ee-1cd8-9c64-bdb11b6df1fe@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-08-15 20:44:17 Re: Looking for software to 'enqueue' connections
Previous Message Melvin Davidson 2016-08-15 20:36:15 Re: 9.2 to 9.5 pg_upgrade losing data