Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzIEz-0004bK-22 for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jan 2013 02:45:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TzIEx-00007U-Qv for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jan 2013 02:45:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzIEw-00007I-Pn for pgsql-performance@postgresql.org; Sun, 27 Jan 2013 02:45:02 +0000 Received: from mh11.mail.rice.edu ([128.42.199.30]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzIEs-0007r6-6q for pgsql-performance@postgresql.org; Sun, 27 Jan 2013 02:45:01 +0000 Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 6F9D34C01A1; Sat, 26 Jan 2013 20:44:56 -0600 (CST) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 514B04C01B1; Sat, 26 Jan 2013 20:44:56 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id AHRBCHcW6fRy; Sat, 26 Jan 2013 20:44:56 -0600 (CST) X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh11.mail.rice.edu (Postfix) with ESMTP id 2E9764C01A1; Sat, 26 Jan 2013 20:44:56 -0600 (CST) Received: by aart.rice.edu (Postfix, from userid 18612) id 24ACA10026A; Sat, 26 Jan 2013 20:45:05 -0600 (CST) Date: Sat, 26 Jan 2013 20:45:05 -0600 From: "ktm@rice.edu" To: belal hamed Cc: pgsql-performance@postgresql.org Subject: Re: PostgreSQL over internet Message-ID: <20130127024505.GA12423@aart.rice.edu> References: 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.2 (----) 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: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 try this query > > select "MatID", "MatName", "MatCode" > from "Materials" > where "MatCode" ~* '^1101' > order by "MatCode" > limit 2 > > by wireshark I monitor TCP packets I found total data transmit/received 400B > I took about 2.5s to fetch results why ?????? > > after trying every solution mentioned in previous messages (DNS, tcpip, > postgresql.conf, ...) not found any improve, > > I tried this one: > > using Zebedee(http://www.winton.org.uk/zebedee/) > I build an IP tunnel between me and my data server (I used compression > level 9) > > surprisingly same query now took about 600 ms, "very impressive" > > same thing with this query > select "MatID", "MatName", "MatCode", "MatParent" from "Materials" > from 48s down to 17s > > all these tests done on same connection with same devices so same dns, > tcp-ip, .... > > now I am sure there is something wrong with libpq. 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. 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