Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzLUP-0001g8-0p for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jan 2013 06:13:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TzLUO-0000d3-7B for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jan 2013 06:13:12 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzLUN-0000cx-0U for pgsql-performance@postgresql.org; Sun, 27 Jan 2013 06:13:11 +0000 Received: from www.ruo3.org ([87.194.171.29] helo=chocolate.ruo3.org) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzLUK-0002r9-NJ for pgsql-performance@postgresql.org; Sun, 27 Jan 2013 06:13:09 +0000 Received: from [127.0.0.1] (chocolate.ruo3.org [127.0.0.1]) by chocolate.ruo3.org (Postfix) with ESMTP id 1B04056021C; Sun, 27 Jan 2013 06:13:05 +0000 (GMT) Message-ID: <5104C570.2030001@richardneill.org> Date: Sun, 27 Jan 2013 06:13:04 +0000 From: Richard Neill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "ktm@rice.edu" CC: belal hamed , pgsql-performance@postgresql.org Subject: Re: PostgreSQL over internet References: <20130127024505.GA12423@aart.rice.edu> In-Reply-To: <20130127024505.GA12423@aart.rice.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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