postgresml / pgcat

PostgreSQL pooler with sharding, load balancing and failover support.
MIT License
3.13k stars 193 forks source link

Pgcat less performant than pgbouncer or misconfiguration? #872

Open garry-t opened 1 week ago

garry-t commented 1 week ago

Describe the bug I expect that pgcat has to be more performant than pgbouncer at least due multithreading, but seem like it is not. I've run simple syntetic test, see below. I need to get TPS value high as much as possible. And no matter what pool size I set for pfgcat and how many workers, pgbouncer has always an advantage in TPS. To Reproduce

  1. Install pgcat and configure with pool size 100, workers = 2
  2. Install pgbouncer set pool size 100
  3. Run pgbench from another VM pgbench -c 100 -j 2 -t 1000 db -h IP -p 6433|6432 -U user

Expected behavior TPS higher than for pgbouncer

Screenshots n/a Desktop (please complete the following information):

Test results: both tools configured to transaction mode. Pool size set 100 for pgcat and pgbouncer, max_connection set to 200.

# pgcat 

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 100
number of threads: 2
number of transactions per client: 1000
number of transactions actually processed: 100000/100000
latency average = 118.267 ms
initial connection time = 102.550 ms
tps = 845.546899 (without initial connection time)

# pgbouncer

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 100
number of threads: 2
number of transactions per client: 1000
number of transactions actually processed: 100000/100000
latency average = 110.804 ms
initial connection time = 148.209 ms
tps = 902.494788 (without initial connection time)

# postgresql

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 100
number of threads: 2
number of transactions per client: 1000
number of transactions actually processed: 100000/100000
latency average = 114.526 ms
initial connection time = 956.368 ms
tps = 873.167031 (without initial connection time)