X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2204AD1B196 for ; Tue, 6 Jul 2004 22:27:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81427-10 for ; Wed, 7 Jul 2004 01:27:56 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id 61EF5D1B190 for ; Tue, 6 Jul 2004 22:27:52 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1Bi1Dt-00072X-00; Tue, 06 Jul 2004 21:27:45 -0400 To: L J Bayuk Cc: "Nigel J. Andrews" , pgsql-interfaces@postgresql.org Subject: Re: pgin.tcl pg_exec_prepared slow (was: Released...) References: <24110.1087945736@sss.pgh.pa.us> <20040706010731.GA15183@bxlbisnugqvi.mindspring.com> In-Reply-To: <20040706010731.GA15183@bxlbisnugqvi.mindspring.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 06 Jul 2004 21:27:45 -0400 Message-ID: <878ydwsj1q.fsf@stark.xeocode.com> Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200407/13 X-Sequence-Number: 5019 L J Bayuk writes: > The delay we are seeing (about 40 ms) is from the time the client sends the > Bind message to PostgreSQL until it gets a TCP ACK back. You might consider disabling the NAGLE algorithm. It can delay acks like this. You could do this with setsockopt(SOL_TCP, TCP_NODELAY,...) The problem is that while this would be perfectly appropriate for things like bind messages, it's entirely inappropriate for the bulk data transfer of the results of a query. I would not suggest enabling TCP_NODELAY for all data. And I'm not sure how implementations behave if you turn it on and off. -- greg