pgbench result on one Postgres better then on Cluster

32 views
Skip to first unread message

Александр Черкашин

unread,
May 13, 2021, 8:34:01 AM5/13/21
to citus-users
I have try to test perfomance on separated Postgres server and Citus 4 nodes cluster whit one coordinator. All HW is identical.

On separatly Postgres:
postgres@gtm-02:~$ pgbench postgres -j 64 -c 256 -f test.sql -T 60
starting vacuum...end.
transaction type: test.sql
scaling factor: 1
query mode: simple
number of clients: 256
number of threads: 64
duration: 60 s
number of transactions actually processed: 480404
latency average = 32.267 ms
tps = 7933.887348 (including connections establishing)
tps = 8055.347058 (excluding connections establishing)

On Citus cluster:
postgres@gtm-01:~$ pgbench postgres -j 64 -c 256 -f test.sql -T 60
starting vacuum...end.
transaction type: test.sql
scaling factor: 1
query mode: simple
number of clients: 256
number of threads: 64
duration: 60 s
number of transactions actually processed: 210377
latency average = 73.844 ms
tps = 3466.780976 (including connections establishing)
tps = 3522.845370 (excluding connections establishing)

postgres@gtm-01:~$ cat test.sql
\set nbranches :scale
\set ntellers 10 * :scale
\set naccounts 100000 * :scale
\set aid random(1, :naccounts)
\set bid random(1, :nbranches)
\set tid random(1, :ntellers)
\set delta random(-5000, 5000)
INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);

Perfomance on cluster is less than on cluster.

If table not distributed i can see one time:
postgres=# select * from pgbench_history; Time: 320.778 ms 
then:
postgres=# SELECT create_distributed_table('pgbench_history', 'aid'); NOTICE: Copying data from local table... NOTICE: copying the data has completed DETAIL: The local data in the table is no longer visible, but is still on disk. HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.pgbench_history$$) create_distributed_table -------------------------- (1 row) Time: 955.560 ms 
and ...
postgres=# select * from pgbench_history; Time: 1341.283 ms (00:01.341) 

??? Time is increase! 
What i have wrong doing?
 

Reply all
Reply to author
Forward
0 new messages