Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 622969FB632 for ; Fri, 25 May 2007 13:34:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 33474-10 for ; Fri, 25 May 2007 13:34:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pop5-1.us4.outblaze.com (pop5-1.us4.outblaze.com [205.158.62.125]) by postgresql.org (Postfix) with SMTP id 8D7B59FB615 for ; Fri, 25 May 2007 13:34:41 -0300 (ADT) Received: (qmail 12848 invoked from network); 25 May 2007 16:35:02 -0000 Received: from unknown (HELO nbd.it.uc3m.es) (ptb:linuxmail.org?linuxmail.org@linuxmail.org@163.117.139.192) by pop5-1.us4.outblaze.com with SMTP; 25 May 2007 16:35:02 -0000 Received: from inv.it.uc3m.es (oboe.it.uc3m.es [163.117.139.101]) by nbd.it.uc3m.es (8.13.1/8.13.1/Debian-15) with ESMTP id l4PGYbkN028373; Fri, 25 May 2007 18:34:37 +0200 Received: (from ptb@localhost) by inv.it.uc3m.es (8.11.0/8.11.0) id l4PGYak16803; Fri, 25 May 2007 18:34:36 +0200 From: "Peter T. Breuer" Message-Id: <200705251634.l4PGYak16803@inv.it.uc3m.es> Subject: Re: general PG network slowness (possible cure) (repost) In-Reply-To: <11030.1180109781@sss.pgh.pa.us> from "Tom Lane" at "May 25, 2007 12:16:21 pm" To: "Tom Lane" Date: Fri, 25 May 2007 18:34:36 +0200 (MET DST) CC: ptb@inv.it.uc3m.es, "Alvaro Herrera" , "Richard Huxton" , pgsql-performance@postgresql.org X-Anonymously-To: Reply-To: ptb@inv.it.uc3m.es X-message-flag: Had your Outlook virus, today? http://www.counterpane.com/crypto-gram-0103.html#4 X-WebTV-Stationery: Standard\; BGColor=black\; TextColor=black Reply-By: Sat, 1 Apr 2006 14:21:08 -0700 X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/520 X-Sequence-Number: 24910 "Also sprach Tom Lane:" > > It may still be useful. The kernel won't necessarily send data as you > > push it down to the network protocols and driver. The driver may decide > > to wait for more data to accumulate, > > No, because we set TCP_NODELAY. Once we've flushed a message to the That just means "disable Nagle", which is indeed more or less the correct thing to do .. you don't want to sit around waiting for more data when we're sure there will be none, as you say. Yet you also don't want to send short data out prematurely, which disabling Nagle can cause. And disabling Nagle doesn't actually force data out immediately you want it to be sent ... it just disables extra waits imposed by the Nagle algorithm/protocol. It doesn't stop the driver from waiting around because it feels taking the bus might be a bit premature right now, for example. > kernel, we don't want the kernel sitting on it --- any delay there adds > directly to the elapsed query time. At least this is the case for the > final response to a query. I'm not too clear on whether this means we > need to be careful about intermediate message boundaries when there's a > lot of data being sent. It's unclear. But not my situation. If I clear TCP_CORK all data is sent at that point. If I set TCP_CORK data is held until I clear TCP_CORK, or 200ms have passed with no send. Peter