X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D93489DCD57 for ; Fri, 10 Feb 2006 11:38:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04854-01 for ; Fri, 10 Feb 2006 11:38:05 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7D54A9DCBDA for ; Fri, 10 Feb 2006 11:37:58 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k1AFc19K019556; Fri, 10 Feb 2006 10:38:01 -0500 (EST) To: Arnaud Lesauvage cc: pgsql-odbc@postgresql.org Subject: Re: TCP_NO_DELAY & TcpAckFrequency (Re: Slow query through In-reply-to: <43ECA243.2050705@freesurf.fr> References: <6BCB9D8A16AC4241919521715F4D8BCE6C7FD9@algol.sollentuna.se> <43EC712E.1060707@freesurf.fr> <43ECA243.2050705@freesurf.fr> Comments: In-reply-to Arnaud Lesauvage message dated "Fri, 10 Feb 2006 15:25:07 +0100" Date: Fri, 10 Feb 2006 10:38:01 -0500 Message-ID: <19555.1139585881@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200602/67 X-Sequence-Number: 7196 Arnaud Lesauvage writes: > OK, but Magnus is affirmative that TCP_NO_DELAY is enabled on both > the client and the server. > So sending ACKs more frequently should not change the behaviour of > the Nagle algorithm. Yeah. The speculations quoted in http://archives.postgresql.org/pgsql-odbc/2006-02/msg00046.php as to the server behavior were completely wrong: we do use NODELAY and we don't have any weird zero-copy algorithm. However, it is true that we push out data in 8K bufferloads, which doesn't match well to typical TCP MTU sizes. I've occasionally wondered whether we should not try to make the bufferload a multiple of the MTU size when using a TCP connection, just so that no "short" packets get sent unnecessarily. (For a known MTU length, it'd be trivial to change the hard-wired buffer size on the server side just to experiment and see if there's any speedup.) None of this explains why odbc is slow when psql isn't, though, especially not if you are using one of the recent odbc releases that relies on libpq. The wire-level behavior certainly ought to be the same for anything using libpq ... regards, tom lane