Re: pgbench: option delaying queries till connections establishment?
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: pgsql-hackers@postgresql.org
Date: 2020-02-29T17:37:45Z
Lists: pgsql-hackers
Hi, On 2020-02-29 15:29:19 +0100, Fabien COELHO wrote: > Pgbench is more or less designed to run a long hopefully steady-state > benchmark, so that the initial connection setup is always negligeable. Not > complying with this hypothesis quite often leads to weird results. I don't think this is a good starting point. Sure, a longer run will yield more precise results, and one needs more than just an instantaneous measurement. But in a lot of cases we want to use pgbench to measure a lot of different variations, making it infeasible for each run to be all that long. Of course whether that's feasible depends on the workload (e.g. readonly runs can be shorter than read/write runs). Also note that in the case that made me look at this, you'd have to run the test for *weeks* to drown out the performance difference that's solely caused by difference in how long individual connects are established. Partially because the "excluding connection establishing" number is entirely broken, but also because fewer connections having been established changes the performance so much. I think we should also consider making pgbench actually use non-blocking connection establishment. It seems pretty weird that that's the one libpq operation where we don't? In particular for -C, with -c > -j, that makes the results pretty meaningless. > Adding a synchronization barrier should be simple enough, I thought about it > in the past. > > However, I'd still be wary that it is no silver bullet: if you start a lot > of threads compared to the number of available cores, pgbench would > basically overload the system, and you would experience a lot of waiting > time which reflects that the client code has not got enough cpu time. > Basically you would be testing the OS process/thread management performance. Sure, that's possible. But I don't see what that has to do with the barrier? Also, most scripts actually have client/server interaction... Greetings, Andres Freund
Commits
-
Fix new pthread code to respect --disable-thread-safety.
- de91c3b976cf 14.0 landed
-
Add missing pthread_barrier_t.
- 44bf3d5083e1 14.0 landed
-
pgbench: Improve time logic.
- 547f04e7348b 14.0 landed
-
pgbench: Refactor thread portability support.
- b1d6a8f86813 14.0 landed
-
pgbench: Synchronize client threads.
- aeb57af8e640 14.0 landed
-
Fix bogus logic for skipping unnecessary partcollation dependencies.
- 84d514887f9c 12.0 cited