Basic script to benchmark pgbouncer vs direct connection
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


hacked together script to benchmark pgbouncer vs destroying and recreating a connection for every single query

usage: ./

edit the variables at the top to specify which host and ports to run against.

Should've added command line arguments, but needed this in a hurry.

If you use this with greater than about 28,000 connections being created and destroyed on linux, you probably need to modify the following sysctl variable or you'll run out of sockets because they'll be in TIME_WAIT.

net.ipv4.tcp_tw_reuse = 1

There's a great writeup about that here: