Re: PostgreSQL over internet

From: Richard Neill <rn214(at)richardneill(dot)org>
To: "ktm(at)rice(dot)edu" <ktm(at)rice(dot)edu>
Cc: belal hamed <belalhamed(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: PostgreSQL over internet
Date: 2013-01-27 06:13:04
Message-ID: 5104C570.2030001@richardneill.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 27/01/13 02:45, ktm(at)rice(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message belal hamed 2013-01-27 12:09:55 Re: PostgreSQL over internet
Previous Message Satoshi Nagayasu 2013-01-27 04:24:27 Re: [PERFORM] pgbench to the MAXINT