Postgres and wsl2 and podman vs. Postgres and windows
Windows
$ ./pgbench -U postgres -c 10 -j 2 -T 60 pgbench
Password:
pgbench (14.2)
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 10
query mode: simple
number of clients: 10
number of threads: 2
duration: 60 s
number of transactions actually processed: 303691
latency average = 1.966 ms
initial connection time = 302.140 ms
tps = 5087.274385 (without initial connection time)
podman/wsl2
$ ./pgbench -U postgres -c 10 -j 2 -T 60 -p 5433 pgbench
Password:
pgbench (14.2, server 14.10 (Debian 14.10-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 10
query mode: simple
number of clients: 10
number of threads: 2
duration: 60 s
number of transactions actually processed: 110853
latency average = 5.408 ms
initial connection time = 62.968 ms
tps = 1849.121013 (without initial connection time)
8 comments
[ 4.9 ms ] story [ 29.4 ms ] thread1) podman volume create (and use that volume in the container) 2) do not specify a volume (allowing postgres to write to its own data directory i the container)
The results for both approaches are the same.
I didn't try creating an external bind mount to a Windows directory as I read many articles concluding that this is slow.
Remembering all my experience with WSL I'd guess there are things going on in the background that are hard to debug
directly in ubuntu on wsl
pgbench -c 10 -j 2 -T 60 pgbench
pgbench (14.10 (Ubuntu 14.10-0ubuntu0.22.04.1)) starting vacuum...end. transaction type: <builtin: TPC-B (sort of)> scaling factor: 10 query mode: simple number of clients: 10 number of threads: 2 duration: 60 s number of transactions actually processed: 197411 latency average = 3.039 ms initial connection time = 8.475 ms tps = 3290.474266 (without initial connection time)