From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David Ventimiglia <davidaventimiglia@hasura.io>
To: pgsql-general@lists.postgresql.org
Subject: Re: Help with a good mental model for estimating PostgreSQL throughput
Date: Mon, 30 Oct 2023 16:46:26 +0100
Message-ID: <c7e89fed5f1c544ba022b0332a492bdbe508e2fc.camel@cybertec.at> (raw)
In-Reply-To: <CADE7j6jZxjcDvw6PEN5aVrm27eq30f2obZu=0psbgdFL9gc7Gw@mail.gmail.com>
References: <CADE7j6jZxjcDvw6PEN5aVrm27eq30f2obZu=0psbgdFL9gc7Gw@mail.gmail.com>
On Mon, 2023-10-30 at 08:05 -0700, David Ventimiglia wrote:
> Can someone help me develop a good mental model for estimating PostgreSQL throughput?
> Here's what I mean. Suppose I have:
> * 1000 connections
> * typical query execution time of 1ms
> * but additional network latency of 100ms
> What if at all would be an estimate of the number of operations that can be performed
> within 1 second? My initial guess would be ~10000, but then perhaps I'm overlooking
> something. I expect a more reliable figure would be obtained through testing, but
> I'm looking for an a priori back-of-the-envelope estimate. Thanks!
It depends on the number of cores, if the workload is CPU bound.
If the workload is disk bound, look for the number of I/O requests a typical query
needs, and how many of them you can perform per second.
The network latency might well be a killer.
Use pgBouncer with transaction mode pooling.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, davidaventimiglia@hasura.io
Subject: Re: Help with a good mental model for estimating PostgreSQL throughput
In-Reply-To: <c7e89fed5f1c544ba022b0332a492bdbe508e2fc.camel@cybertec.at>
References: <CADE7j6jZxjcDvw6PEN5aVrm27eq30f2obZu=0psbgdFL9gc7Gw@mail.gmail.com> <c7e89fed5f1c544ba022b0332a492bdbe508e2fc.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox