pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedPGBench on Windows - connections are subprocesses?
4+ messages / 2 participants
[nested] [flat]
* PGBench on Windows - connections are subprocesses?
@ 2020-07-20 13:20 Durumdara <durumdara@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Durumdara @ 2020-07-20 13:20 UTC (permalink / raw)
To: pgsql-general
Dear Members!
I have a question about PGBench for Windows (9,6).
I want to understand the working method of this tool for use well
in the test series.
This has more options, like connections (c).
As I tried the c controls how much concurrent connections must be used in
the test. For example c 10 increases with ten. It's ok.
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.
a.)
It makes C subprocesses with connections and every of them makes his work
concurrently?
b.)
It makes N connections on one thread/process. Hut only one works at the
same time. J controls how much works at the same time. The other
connections are sleeping.
1. c started/has finished.
2. c started/has finished.
N. c started/has finished.
End.
(This is a little bit senseless)
c.)
It makes C subthreads and every thread has it's connection. They work
concurrently (like in case a).
It could be ok, but why can I set threads with the "j" option - when
subthreads must be equal with the number of connections.
Do you know something about the background of this utility?
We have to move to the next server which is different from the actual one,
and I need to measure them to detect the possible problems.
To compare the result I must understand the operations.
Very-very thank you for each answer you write!
Best regards
DD
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PGBench on Windows - connections are subprocesses?
@ 2020-07-20 13:38 Tom Lane <tgl@sss.pgh.pa.us>
parent: Durumdara <durumdara@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Tom Lane @ 2020-07-20 13:38 UTC (permalink / raw)
To: Durumdara <durumdara@gmail.com>; +Cc: pgsql-general
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PGBench on Windows - connections are subprocesses?
@ 2020-07-20 13:38 Durumdara <durumdara@gmail.com>
parent: Durumdara <durumdara@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Durumdara @ 2020-07-20 13:38 UTC (permalink / raw)
To: pgsql-general
I extend the question to understand why I was confused about this.
In Delphi the connections are thread based. From a thread you can use more
connections. But you can't use a connection from two or more threads
concurrently! You can use subprocess farm, or subthread farm to make
parallel performance tests.
Durumdara <durumdara@gmail.com> ezt írta (időpont: 2020. júl. 20., H,
15:20):
> Dear Members!
>
>
> I have a question about PGBench for Windows (9,6).
>
> I want to understand the working method of this tool for use well
> in the test series.
>
> This has more options, like connections (c).
>
> As I tried the c controls how much concurrent connections must be used in
> the test. For example c 10 increases with ten. It's ok.
>
> 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.
>
> a.)
> It makes C subprocesses with connections and every of them makes his work
> concurrently?
>
> b.)
> It makes N connections on one thread/process. Hut only one works at the
> same time. J controls how much works at the same time. The other
> connections are sleeping.
> 1. c started/has finished.
> 2. c started/has finished.
> N. c started/has finished.
> End.
> (This is a little bit senseless)
>
> c.)
> It makes C subthreads and every thread has it's connection. They work
> concurrently (like in case a).
> It could be ok, but why can I set threads with the "j" option - when
> subthreads must be equal with the number of connections.
>
> Do you know something about the background of this utility?
>
> We have to move to the next server which is different from the actual one,
> and I need to measure them to detect the possible problems.
> To compare the result I must understand the operations.
>
> Very-very thank you for each answer you write!
>
> Best regards
> DD
>
>
>
>
>
>
>
>
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PGBench on Windows - connections are subprocesses?
@ 2020-07-20 14:08 Durumdara <durumdara@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Durumdara @ 2020-07-20 14:08 UTC (permalink / raw)
To: pgsql-general
Dear Tom!
Tom Lane <tgl@sss.pgh.pa.us> ezt írta (időpont: 2020. júl. 20., H, 15:38):
>
> 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.
>
Without -j, we have N connections, but one thread.
So this thread serves all of the connections one by one? The 1. and 2. and
3. connection while others do nothing (standing by)?
Or like Round Robin: a job from C1, next job from C2, .... job from CN -
then job from C1.... and no more jobs?
And if J = C means realtime parallel test?
Because each thread has only one connection, and they work concurrently as
real users do?
Then if I want to simulate 500 users heavy work, I need to set J=C=500?
Thank you for the information!
BW
DD
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-07-20 14:08 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 13:20 PGBench on Windows - connections are subprocesses? Durumdara <durumdara@gmail.com>
2020-07-20 13:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-07-20 14:08 ` Durumdara <durumdara@gmail.com>
2020-07-20 13:38 ` Durumdara <durumdara@gmail.com>
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