vitabaks / postgresql_cluster

Automated database platform for PostgreSQL® A modern, open-source alternative to cloud-managed databases.
https://postgresql-cluster.org
MIT License
1.83k stars 418 forks source link

Volume performance (Local storage vs Volume on Hetzner) #783

Open zimski opened 1 month ago

zimski commented 1 month ago

I have done some experiment on the Hetzner provider to bench the performance local disk vs external volumes.

My results: on a CCX23 4 dedicated CPU 16Gb RAM

Local SSD Disk

root@db-01:~/db# docker exec -ti db-01 bash
9208129e6f4f:~$ pgbench -h /rds/socket/ -c 10 -j 2 -t 10000 bench
pgbench (14.12)
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 10
number of threads: 2
number of transactions per client: 10000
number of transactions actually processed: 100000/100000
latency average = 2.069 ms
initial connection time = 25.821 ms
tps = 4834.335072 (without initial connection time)

Attached Volume

20729d18c2a1:~$ pgbench -h /rds/socket/ -c 10 -j 2 -t 10000 bench
pgbench (14.12)
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 10
number of threads: 2
number of transactions per client: 10000
number of transactions actually processed: 100000/100000
latency average = 5.691 ms
initial connection time = 25.888 ms
tps = 1757.123471 (without initial connection time)

We have here a 73% performance loss when we use the external volume.

The volume is handy, it allows us to have the desired storage whatever the local disk of the VM.

For the users who have enough space on the VM, having the volume optional can be useful to juice all the performance from the cluster

vitabaks commented 1 month ago

Thanks for sharing this test.

We plan to add the option to select the volume type in the “Expert Mode”.