Hi, probably a noob question, but I'm connecting to a distant Neon db, and the latencies I'm seeing

Hi, probably a noob question, but I'm connecting to a distant Neon db, and the latencies I'm seeing suggest that my query always takes 2 round trips (350ms latency, while pinging the Neon server takes 150ms and VPNing to a location near the server drops the latency to 50ms). This is even if I just hit Neon a few seconds earlier. I connect using postgres(connStr, {max: 5, fetch_types: false,}) (not that I need more than one connection but the docs suggested setting max to 5) and I have the cache disabled since the purpose of my query is to catch updates to a counter due to mutations by other clients. My app is not yet publicly released, so there is very little traffic.
Was this page helpful?