Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 30641 invoked from network); 17 Sep 2010 17:17:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Sep 2010 17:17:16 -0000 Received: (qmail 91691 invoked by uid 500); 17 Sep 2010 17:17:14 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 91603 invoked by uid 500); 17 Sep 2010 17:17:13 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 91595 invoked by uid 99); 17 Sep 2010 17:17:13 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 17:17:13 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of michael.greene@gmail.com designates 209.85.214.44 as permitted sender) Received: from [209.85.214.44] (HELO mail-bw0-f44.google.com) (209.85.214.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 17:16:51 +0000 Received: by bwz9 with SMTP id 9so3825448bwz.31 for ; Fri, 17 Sep 2010 10:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=eBzxl8mRpyoHl7NGAQFoHeV7s0Zww8m1tibPUWWZP6c=; b=ptLhj/+fCA6UeyFMQHgNCedWx4sy1Z7ZpL/woI5X2vdtyXxJm3gQkbNZiKMWasDtuP NfAh3aIqe7aB+dnIv1O4hCTY44t8ipocaavrm0+1Er+YlCh/wIys4jNO/2EdmwN1gqgM Cl4qjC/9jfVFwZX9S84OEfHaLLUpzvYmjY3nM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WE+xEMSVbSBqQejdir3Glq7AtnLqTGV+eQma5pS6b5CJSkdRELzVrcz4r1eOw3cVux VtDqrrEES+HImVpNwCmOCSAUG9j5ekx1HgeLHDwLbEBAA9CaNimkbACFl8/pZHevI1h+ ZebsKTwmSM5Scz3H60IoHM7MbQvzXpaOclUGQ= MIME-Version: 1.0 Received: by 10.204.68.67 with SMTP id u3mr3920264bki.199.1284743790942; Fri, 17 Sep 2010 10:16:30 -0700 (PDT) Received: by 10.204.61.146 with HTTP; Fri, 17 Sep 2010 10:16:30 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Sep 2010 12:16:30 -0500 Message-ID: Subject: Re: Network latency on Cassandra 0.7 (TFramedTransport) From: Michael Greene To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=00504502d81a495c71049077b9d3 X-Virus-Checked: Checked by ClamAV on apache.org --00504502d81a495c71049077b9d3 Content-Type: text/plain; charset=ISO-8859-1 This is the correct cause. Reproducing your test gives 38-45ms in each of 10 runs. If you run a profiler against it, you can see that the time is entirely spent blocking on receive in TStreamTransport.Read. Your test can be modified with the following line: coreTransport.TcpClient.NoDelay = true; After disabling Nagle's each test runs in < 1ms. Michael On Fri, Sep 17, 2010 at 9:57 AM, Peter Schuller wrote: > > The latency is about 200 ms on every request when I'm connected to > another > > My first thought here was that maybe you're seeing the effects of > nagle[1] + delayed acks on the other side. On Unix, normally something > like a thrift client would set TCP_NODELAY on its socket to avoid the > problem. I'm not sure whether or not this is a reasonable hypothesis > with C# + Thrift on Windows. Sorry, I don't know what the easy fix is > either but perhaps it might help dig further. > > [1] http://en.wikipedia.org/wiki/Nagle's_algorithm > > -- > / Peter Schuller > --00504502d81a495c71049077b9d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This is the correct cause. =A0Reproducing your test gives 38-45ms in each o= f 10 runs. =A0If you run a profiler against it, you can see that the time i= s entirely spent blocking on receive in TStreamTransport.Read.

Your test can be modified with the following line:
coreTransport.T= cpClient.NoDelay =3D true;

After disabling Nagle's each t= est runs in < 1ms.

Michael

On Fri, Sep 17, 2010 at 9:57 AM, Peter Schuller <peter.schuller@infidyne.com&g= t; wrote:
> The latency is about 200 ms on every request when I&= #39;m connected to another

My first thought here was that maybe you're seeing the effects of=
nagle[1] + delayed acks on the other side. On Unix, normally something
like a thrift client would set TCP_NODELAY on its socket to avoid the
problem. I'm not sure whether or not this is a reasonable hypothesis with C# + Thrift on Windows. Sorry, I don't know what the easy fix is either but perhaps it might help dig further.

[1] http://en.wikipedia.org/wiki/Nagle's_algorithm

--
/ Peter Schuller

--00504502d81a495c71049077b9d3--