Re: pgbench: option delaying queries till connections establishment?

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Dave Cramer <davecramer@postgres.rocks>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org
Date: 2023-07-03T07:24:17Z
Lists: pgsql-hackers
Hello Dave,

>> I am running pgbench with the following
>> pgbench -h localhost -c 100 -j 100 -t 2 -S -s 1000 pgbench -U pgbench
>> --protocol=simple
>>
>> Without pgbouncer I get around 5k TPS
>> with pgbouncer I get around 15k TPS
>>
>> Looking at the code connection initiation time should not be part of the
>> calculation so I' puzzled why pgbouncer is making such a dramatic
>> difference ?
>
> Turns out that for this specific test, pg is faster with a pooler.

This does not tell "why".

Does the pooler prepares statements, whereas "simple" does not?

-- 
Fabien.



Commits

  1. Fix new pthread code to respect --disable-thread-safety.

  2. Add missing pthread_barrier_t.

  3. pgbench: Improve time logic.

  4. pgbench: Refactor thread portability support.

  5. pgbench: Synchronize client threads.

  6. Fix bogus logic for skipping unnecessary partcollation dependencies.