Re: Postgresql - Pgbouncer Connection and Query Performance Problem

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Abdullah Ergin <abdullaherginwork(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Postgresql - Pgbouncer Connection and Query Performance Problem
Date: 2024-04-03 06:24:47
Message-ID: bf84d8ea3086056bcd19aa6fa04d9d894c7f8102.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, 2024-04-02 at 17:04 +0300, Abdullah Ergin wrote:
> [large connection pool size]
> Thank you for the information. What would you recommend as the value
> for this parameter? Would 100 be too large of a number? Or maybe 50?

That depends entirely on your hardware and the database workload.
Perhaps reading this article can help you:
https://www.cybertec-postgresql.com/en/estimating-connection-pool-size-with-postgresql-database-statistics/

> Additionally, before lowering these parameters, I had a lot of "LWLocks"
> in my database. Normally, I know that these lightweight locks don't cause
> significant issues, but during the slowdown, I was consistently seeing
> 70-80 LWLocks. After lowering the parameters and restarting pooling,
> these locks disappeared. Is there any correlation?

Very likely yes.
If you see many LWLocks, that will cause a significant performance issue.
Essentially, it is contention inside the database.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message jaya kumar 2024-04-03 09:55:23 About Autovacuum Query
Previous Message Dan Smith 2024-04-02 20:09:37 Re: Deadlock