Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzW6e-0004Lg-VD for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jan 2013 17:33:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TzW6d-0004ud-Vc for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jan 2013 17:33:24 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzW6d-0004uV-3K for pgsql-performance@postgresql.org; Sun, 27 Jan 2013 17:33:23 +0000 Received: from mh1.mail.rice.edu ([128.42.201.20]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzW6a-0004Io-JG for pgsql-performance@postgresql.org; Sun, 27 Jan 2013 17:33:22 +0000 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 23D75461752; Sun, 27 Jan 2013 11:33:20 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 2292046174E; Sun, 27 Jan 2013 11:33:20 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id ibHo3nU3YWxP; Sun, 27 Jan 2013 11:33:20 -0600 (CST) X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh1.mail.rice.edu (Postfix) with ESMTP id F422446174C; Sun, 27 Jan 2013 11:33:19 -0600 (CST) Received: by aart.rice.edu (Postfix, from userid 18612) id 0949C10036E; Sun, 27 Jan 2013 11:33:29 -0600 (CST) Date: Sun, 27 Jan 2013 11:33:28 -0600 From: "ktm@rice.edu" To: belal hamed Cc: Richard Neill , pgsql-performance@postgresql.org Subject: Re: PostgreSQL over internet Message-ID: <20130127173328.GA21220@aart.rice.edu> References: <20130127024505.GA12423@aart.rice.edu> <5104C570.2030001@richardneill.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -4.6 (----) 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 Sun, Jan 27, 2013 at 03:09:55PM +0300, belal hamed wrote: > >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. > > How it could be ADSL problem when it's the same in tow tests ? > beside data transferred when using tunnel is much bigger (about 10KB) than > direct connection (400B) > so it should be slower when using tunnel but the result shows it was faster > !!!! > Due to the asymmetric communication, a bigger data output in a single packet (the result of using compression on the tunnel) will get sent without waiting. A smaller packet will delay a bit waiting for some additional data, which in your case does not come. You may want to check out this document describing some of what I believe is causing your observed behavior: http://www.faqs.org/docs/Linux-HOWTO/ADSL-Bandwidth-Management-HOWTO.html#BACKGROUND > >When you wrap the communication channel in an IP tunnel, you are > >collapsing much of the syn-ack of the libpq protocol. You can see > >the same effect trying to run any sort of X windows application. > > If that so, why these is not same option in Postgresql, Is it necessary to > use IP tunnel to do that and perform fast fetch? > > > >Try creating a simple SSH tunnel > my server is windows 7 > > >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. > > I run the same query on same network connection so I eliminate the > slowness caused by the database query and network fundamentally, > nothing left but postgresql/libpq > > not anyone consider there may be a bug when connection to a remote server > over internet in libpq > the only different when I used the tunnel is I connect to localhost > instead of server IP or domain name (I try both) You would find that if you log in to your DB server and use libpq to it over a localhost connection that the performance is good which points to your network as the problem. Regards, Ken -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance