I am running a Drupal site that is backed by Postgres. This is my first time running something with Postgres; I come from the MySQL world.
For doing dev work on the site, I connect to a VPN and tunnel my traffic through a machine that has an IP that is allowed in pg_hba.conf.
The queries are coming back very slow. My logs tell me that loading the homepage on the dev server:
Executed 86 queries in 84.26 ms
And on my local machine (with the remote connection):
Executed 87 queries in 22368.05 ms
Queries are 80% SELECT, with a few INSERT INTOs.
I have done some rudimentary tuning also on the db server, hoping to speed things up for the remote connection (the tuning did not, but it certainly made the dev server's queries come back faster!).
On the server's db config files, I have turned of ssl and only allowed connections from localhost and ips within the VPN. I am authenticating db users via md5.
Could the hold up be going through this VPN? Or could it have to do with the fact that the db is being accessed from two different places with the same username/password?