Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 59053635487 for ; Mon, 23 Feb 2009 15:43:31 -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 82009-07 for ; Mon, 23 Feb 2009 15:43:28 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mail.postgresql.org (Postfix) with ESMTP id 0B3D36350DB for ; Mon, 23 Feb 2009 15:43:28 -0400 (AST) Received: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 3FA08324032 for ; Mon, 23 Feb 2009 13:43:26 -0600 (CST) X-Virus-Scanned: by amavis-2.6.0 at mh3.mail.rice.edu Received: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8eqbobTHKxlC for ; Mon, 23 Feb 2009 13:43:26 -0600 (CST) Received: from cooker.cnx.rice.edu (cooker.cnx.rice.edu [168.7.5.70]) by mh3.mail.rice.edu (Postfix) with ESMTP id F3B5232402E for ; Mon, 23 Feb 2009 13:43:25 -0600 (CST) Received: from reedstrm by cooker.cnx.rice.edu with local (Exim 3.36 #1 (Debian)) id 1Lbgi5-0004Qy-00 for ; Mon, 23 Feb 2009 13:43:25 -0600 Date: Mon, 23 Feb 2009 13:43:25 -0600 From: "Ross J. Reedstrom" To: pgsql-performance Subject: Re: TCP network cost Message-ID: <20090223194325.GB14802@cooker> Mail-Followup-To: "Ross J. Reedstrom" , pgsql-performance References: <20090217070403.GB2486@cooker> <1ca1c1410902171013q478f2620n13fcd68cb8b3d911@mail.gmail.com> <3FAF940B-9B0B-4DBA-8728-6096022129DF@infogears.com> <20090217200416.GA23707@cooker> <20090217211454.GB23707@cooker> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200902/271 X-Sequence-Number: 32852 On Thu, Feb 19, 2009 at 02:09:04PM +0100, PFC wrote: > > >python w/ psycopg (or psycopg2), which wraps libpq. Same results w/ > >either version. > > I've seen psycopg2 saturate a 100 Mbps ethernet connection (direct > connection with crossover cable) between postgres server and client during > a benchmark... I had to change the benchmark to not retrieve a large TEXT > column to remove this bottleneck... this was last year so versions are > probably different, but I don't think this matters a lot... Here's the core of the problem: I in fact need to transfer exactly that: a large single field (bytea in my case). I suspect psycopg[12] is having issues w/ memory allocation, but that's just an unsupported gut feeling. The final upshot is that I need to restructure my config to use the large-object API (and hence a snapshot of psycopg2) to get decent throughput. > You should test with sending a large (>100 MB) amount of data > through Netcat. This should give you your maximum wire speed. Use > /dev/null as the test file, and use "pv" (pipe viewer) to measure > throughput : > > box 1 : pv < /dev/zero | nc -lp 12345 > box 2 : nc (ip) 12345 >/dev/null > > On gigabit lan you should get 100 MB/s, on 100BaseT about 10 MB/s. 112 MB/s, and 233 MB/s for localhost. Thanks for the pointer to pv: looks like a nice tool. Investigating this problem has lead me to a number of nice 'old school' tools: the other is tcptrace and xplot.org. I've been hand reading tcpdump output, or clicking around in ethereal/wireshark. I like tcptrace's approach. 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