Re: PGBench on Windows - connections are subprocesses?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Durumdara <durumdara(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: PGBench on Windows - connections are subprocesses?
Date: 2020-07-20 13:38:10
Message-ID: 401420.1595252290@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Durumdara <durumdara(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Durumdara 2020-07-20 13:38:14 Re: PGBench on Windows - connections are subprocesses?
Previous Message Adrian Klaver 2020-07-20 13:37:56 Re: Steps required for increasing disk size in EC2 instance with minimal downtime