Npgsql with Pgbouncer on Kubernetes - hight latency Npgsql with Pgbouncer on Kubernetes - hight latency kubernetes kubernetes

Npgsql with Pgbouncer on Kubernetes - hight latency


There seem to be multiple questions there...

First, Npgsql's pool is an in-process pool, where the overhead of opening and closing is extremely small. With PgBouncer your application still has to establish a TCP connection (and possibly even an SSL one), which is a non-negligible overhead. So it's generally recommended to leave Npgsql's pooling on even if you intend to also use pg_bouncer (which can be useful as a server-side pool).

Second, if you're not preparing your statements in anyway, Npgsql sends Parse/Bind/Describe/Execute/Sync for every query. You probably want to take look at the Npgsql docs on preparation.