Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 327639FB854 for ; Fri, 25 May 2007 12:20:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 51626-01 for ; Fri, 25 May 2007 12:20:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D371B9FB851 for ; Fri, 25 May 2007 12:20:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l4PFKIXG009509; Fri, 25 May 2007 11:20:18 -0400 (EDT) To: ptb@inv.it.uc3m.es cc: "Alvaro Herrera" , "Richard Huxton" , pgsql-performance@postgresql.org Subject: Re: general PG network slowness (possible cure) (repost) In-reply-to: <200705251506.l4PF6AW08031@inv.it.uc3m.es> References: <200705251506.l4PF6AW08031@inv.it.uc3m.es> Comments: In-reply-to "Peter T. Breuer" message dated "Fri, 25 May 2007 17:06:10 +0200" Date: Fri, 25 May 2007 11:20:18 -0400 Message-ID: <9508.1180106418@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/515 X-Sequence-Number: 24905 "Peter T. Breuer" writes: > And definitely all those could be grouped if there are several to do. Except that in the situation you're describing, there's only a hundred or two bytes of response to each query, which means that only one send() will occur anyway. (The flush call comes only when we are done responding to the current client query.) It's possible that for bulk data transmission situations we could optimize things a bit better --- in particular I've wondered whether we can reliably find out the MTU of the connection and use that as the output buffer size, instead of trusting the kernel to choose the best message boundaries --- but for the situation you're worried about there will be only one send. regards, tom lane