Re: Issues Scaling Postgres Concurrency

From: Alan Hodgson <ahodgson(at)lists(dot)simkin(dot)ca>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Issues Scaling Postgres Concurrency
Date: 2023-03-14 18:01:35
Message-ID: 20e62f76c0b6e98c390fe020a6da64f072e343be.camel@lists.simkin.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2023-03-13 at 12:24 -0400, Harrison Borges wrote:
> Hello everyone.
>
> I’m running into severe performance problems with Postgres as I
> increase the number of concurrent requests against my backend. I’ve
> identified that the bottleneck is Postgres, and to simplify the
> test case, I created an endpoint that only does a count query on a
> table with ~500k rows. At 5 concurrent users, the response time was
> 33ms, at 10 users it was 60ms, and at 20 users it was 120ms.

I'm no expert on high concurrency, but for something this simple I'd
expect that you're just CPU bottlenecked. Count in PostgreSQL
actually has to read all the rows in the table. And yeah you can't do
too many of them at the same time.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2023-03-14 21:47:43 Re: Issues Scaling Postgres Concurrency
Previous Message Adrian Klaver 2023-03-14 17:34:20 Re: Issues Scaling Postgres Concurrency