pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Durumdara <durumdara@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: PGBench on Windows - connections are subprocesses?
Date: Mon, 20 Jul 2020 09:38:10 -0400
Message-ID: <401420.1595252290@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEcMXhmkiNiz56qgtyjLLstA4yZu-U6v7GeyP3Q3cNDBRm+igw@mail.gmail.com>
References: <CAEcMXhmkiNiz56qgtyjLLstA4yZu-U6v7GeyP3Q3cNDBRm+igw@mail.gmail.com>

Durumdara <durumdara@gmail.com> writes:
> But the number of threads option (j I think) confused me. At first I
> thought the total connection number is simply the multiplication of c and j
> (subconnections).
> As I saw this is untrue.

> So I don't know how this utility works really in the background.

There are -j threads in the pgbench process, and -c connections to
the server (hence -c backend processes on the server side).  Each
of the pgbench threads is responsible for sending queries to a subset
of the connections.  Setting -j more than -c is useless (I forget
if it's actually an error).  If you set -j to, say, half of -c then
each thread has exactly two connections to manage.  If -j is too
small compared to -c then pgbench itself tends to become the bottleneck.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <401420.1595252290@sss.pgh.pa.us>
Permalink:  ../401420.1595252290@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/401420.1595252290@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, durumdara@gmail.com
  Subject: Re: PGBench on Windows - connections are subprocesses?
  In-Reply-To: <401420.1595252290@sss.pgh.pa.us>
  References: <CAEcMXhmkiNiz56qgtyjLLstA4yZu-U6v7GeyP3Q3cNDBRm+igw@mail.gmail.com> <401420.1595252290@sss.pgh.pa.us>

* 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