pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Neill <rn214@richardneill.org>
To: ktm@rice.edu <ktm@rice.edu>
Cc: belal hamed <belalhamed@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: PostgreSQL over internet
Date: Sun, 27 Jan 2013 06:13:04 +0000
Message-ID: <5104C570.2030001@richardneill.org> (raw)
In-Reply-To: <20130127024505.GA12423@aart.rice.edu>
References: <CAHsqH1zQUj5po-1eHK7j_z7k+VdHWNWBK7XfbCxuRskkAj5LSQ@mail.gmail.com>
	<20130127024505.GA12423@aart.rice.edu>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>



On 27/01/13 02:45, ktm@rice.edu wrote:
> On Sun, Jan 27, 2013 at 03:15:45AM +0300, belal hamed wrote:
>>
>> I connect to my server through ADSL connection 4Mbps
>>
>
> Here is your "problem". You need to understand the performance
> characteristics of your communication channel. ADSL is a VERY
> asymmetric communications channel. Down is usually much faster
> than up.

I'm not convinced that ADSL is your problem.

1. Try just SSH directly to the server, and run psql, and run a query 
like this one:
    SELECT 'This is a test message' AS status;

This  should run in under 1ms; it also means that we don't have to worry 
about the details of your database-schema for the purposes of this problem.

2. Try creating a simple SSH tunnel and using your application locally. 
For example, if your server runs Postgresql on port 5432, run this SSH 
command:
   ssh -L 5432:localhost:5432 your_server_hostname
and then connect to your LOCAL (localhost) port 5432; SSH will handle 
the port forwarding.  [Explanation: "localhost" in the SSH command is in 
the context of your_server_hostname]
How does it work now?

3. Try configuration you are currently using, but with the above query.

It should be possible to distinguish between:
   - slowness caused by the database query itself
   - slowness caused by the network fundamentally.
   - slowness caused by the postgresql/libpq.

Hopefully, you'll be able to narrow it down a bit.

HTH,

Richard





-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (7+ messages)  latest in thread

Message-ID: <5104C570.2030001@richardneill.org>
Permalink:  ../5104C570.2030001@richardneill.org/
Also on:    postgresql.org/message-id/5104C570.2030001@richardneill.org

 · 

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: rn214@richardneill.org, ktm@rice.edu, belalhamed@gmail.com
  Subject: Re: PostgreSQL over internet
  In-Reply-To: <5104C570.2030001@richardneill.org>

* 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