Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9AFD79FB7DC for ; Mon, 28 May 2007 18:13:18 -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 10980-01 for ; Mon, 28 May 2007 18:13:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 96FFD9FBBEC for ; Mon, 28 May 2007 18:09:57 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id l4SL8ED06035; Mon, 28 May 2007 17:08:14 -0400 (EDT) From: Bruce Momjian Message-Id: <200705282108.l4SL8ED06035@momjian.us> Subject: Re: general PG network slowness (possible cure) (repost) In-Reply-To: <200705251634.l4PGYak16803@inv.it.uc3m.es> To: ptb@inv.it.uc3m.es Date: Mon, 28 May 2007 17:08:14 -0400 (EDT) CC: Tom Lane , Alvaro Herrera , Richard Huxton , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/577 X-Sequence-Number: 24967 Please let us know if there is something we should change in the PostgreSQL source code. --------------------------------------------------------------------------- Peter T. Breuer wrote: > "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 > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate -- Bruce Momjian http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +