pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Sbob <sbob@quadratum-braccas.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: significant jump in sql statement timing for on server vs a remote connection
Date: Tue, 19 Apr 2022 16:04:21 -0500
Message-ID: <20220419210421.GL26620@telsasoft.com> (raw)
In-Reply-To: <ddbdea4b-f071-c0fd-d645-2724f489bc77@quadratum-braccas.com>
References: <ddbdea4b-f071-c0fd-d645-2724f489bc77@quadratum-braccas.com>

On Tue, Apr 19, 2022 at 03:00:09PM -0600, Sbob wrote:
> We are debugging a sql performance issue. We have a sql file with 50,000
> simple select statements in it. If I run the file locally it completes in
> less than 15sec.  If I force the local connection to be a tcp/ip connection
> via psql -h and I get approximately the same results, 15 - 16sec.
> 
> 
> However if we move the file to another server in the same network and run
> with a psql -h then it runs for more than 10min. Are there any postgres
> specific issues / settings / connection overhead  we should look at? Or is
> this simply a network issue and fully outside the scope of the postgres
> database?

What OS ?  What kind of authentication are you using ?
Is there a connection pooler involved ?  Did you try like that ?

Did you test how long it takes to run 10k empty statements locally vs remotely ?
time yes 'SELECT;' |head -9999 |psql ... >/dev/null

-- 
Justin





view thread (5+ messages)  latest in thread

Message-ID: <20220419210421.GL26620@telsasoft.com>
Permalink:  ../20220419210421.GL26620@telsasoft.com/
Also on:    postgresql.org/message-id/20220419210421.GL26620@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, sbob@quadratum-braccas.com, pgsql-performance@lists.postgresql.org
  Subject: Re: significant jump in sql statement timing for on server vs a remote connection
  In-Reply-To: <20220419210421.GL26620@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox