Re: Issues Scaling Postgres Concurrency - Mailing list pgsql-general

From Alan Hodgson
Subject Re: Issues Scaling Postgres Concurrency
Date
Msg-id 20e62f76c0b6e98c390fe020a6da64f072e343be.camel@lists.simkin.ca
Whole thread Raw
In response to Issues Scaling Postgres Concurrency  (Harrison Borges <harrison@rlly.com>)
List 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.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Issues Scaling Postgres Concurrency
Next
From: Laurenz Albe
Date:
Subject: Re: Issues Scaling Postgres Concurrency