Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id EADAA63309F for ; Tue, 17 Feb 2009 03:12:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45129-07 for ; Tue, 17 Feb 2009 03:12:17 -0400 (AST) X-Greylist: delayed 00:08:10.734822 by SQLgrey-1.7.6 Received: from mh5.mail.rice.edu (mh5.mail.rice.edu [128.42.199.32]) by mail.postgresql.org (Postfix) with ESMTP id 971E663267A for ; Tue, 17 Feb 2009 03:12:17 -0400 (AST) Received: from mh5.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh5.mail.rice.edu (Postfix) with ESMTP id 3FFE815C01B for ; Tue, 17 Feb 2009 01:04:04 -0600 (CST) X-Virus-Scanned: by amavis-2.6.0 at mh5.mail.rice.edu Received: from mh5.mail.rice.edu ([127.0.0.1]) by mh5.mail.rice.edu (mh5.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xr48HLA5tCTU for ; Tue, 17 Feb 2009 01:04:04 -0600 (CST) Received: from cooker.cnx.rice.edu (cooker.cnx.rice.edu [168.7.5.70]) by mh5.mail.rice.edu (Postfix) with ESMTP id 1CFCD15C010 for ; Tue, 17 Feb 2009 01:04:04 -0600 (CST) Received: from reedstrm by cooker.cnx.rice.edu with local (Exim 3.36 #1 (Debian)) id 1LZJzw-0001ez-00 for ; Tue, 17 Feb 2009 01:04:04 -0600 Date: Tue, 17 Feb 2009 01:04:03 -0600 From: "Ross J. Reedstrom" To: pgsql-performance Subject: TCP network cost Message-ID: <20090217070403.GB2486@cooker> Mail-Followup-To: "Ross J. Reedstrom" , pgsql-performance MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200902/182 X-Sequence-Number: 32763 Recently I've been working on improving the performance of a system that delivers files stored in postgresql as bytea data. I was surprised at just how much a penalty I find moving from a domain socket connection to a TCP connection, even localhost. For one particular 40MB file (nothing outragous) I see ~ 2.5 sec. to download w/ the domain socket, but ~ 45 sec for a TCP connection (either localhost, name of localhost, or from another machine 5 hops away (on campus - gigabit LAN) Similar numbers for 8.2.3 or 8.3.6 (on Linux/Debian etch + backports) So, why the 20 fold penalty for using TCP? Any clues on how to trace what's up in the network IO stack? Ross -- Ross Reedstrom, Ph.D. reedstrm@rice.edu Systems Engineer & Admin, Research Scientist phone: 713-348-6166 The Connexions Project http://cnx.org fax: 713-348-3665 Rice University MS-375, Houston, TX 77005 GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E F888 D3AE 810E 88F0 BEDE