PostgreSQL benchmark over Cloud Proxy in GKE: socket vs port

In my bubble it’s always been common knowledge that a database connection over a Unix socket is faster than that same connection over a TCP connection. But does this boat still float when using the Google recommended way to access Cloud SQL from GKE: with Google Cloud Proxy as a sidecar in a pod? Since Cloud Proxy moves data over a TCP tunnel, speed should be identical. So to save everyone a little time, I did some very minimal benchmarking: ...

July 13, 2019 · 3 min · Rutger de Knijf