Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D58EC200C64 for ; Fri, 14 Apr 2017 03:13:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CC868160BAA; Fri, 14 Apr 2017 01:13:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1B288160B98 for ; Fri, 14 Apr 2017 03:13:47 +0200 (CEST) Received: (qmail 86988 invoked by uid 500); 14 Apr 2017 01:13:47 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 86977 invoked by uid 99); 14 Apr 2017 01:13:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2017 01:13:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A22A0CC884 for ; Fri, 14 Apr 2017 01:13:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 4l8ADAmLkZHo for ; Fri, 14 Apr 2017 01:13:45 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5B39E61F81 for ; Fri, 14 Apr 2017 01:13:45 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 67882E0D3D for ; Fri, 14 Apr 2017 01:13:44 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6BAD524099 for ; Fri, 14 Apr 2017 01:13:42 +0000 (UTC) Date: Fri, 14 Apr 2017 01:13:42 +0000 (UTC) From: "Jason Brown (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8457) nio MessagingService MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 14 Apr 2017 01:13:49 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-8457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15968472#comment-15968472 ] Jason Brown commented on CASSANDRA-8457: ---------------------------------------- So, [~aweisberg] and I spent some time talking offline about the expiring messages on the outbound side, and came up with the following: 1. run a periodic, scheduled task in each channel that checks to make sure the channel is making progess wrt sending bytes. If we fail to see any progress being made after some number of seconds, we should close the connection/socket and throw away the messages. 2. repurpose the high/low water mark (and arguably use it more correctly) to indicate when we should stop writing messages to the channel (at the {{ChannelWriter}} layer). Currently, I'm just using the water mark to indicate when we should flush, but a simple check elsewhere would accomplish the same thing. Instead, the water marks should indicate when we really shouldn't write to the channel anymore, and either queue up those messages in something like {{OutboundMessageConnection#backlog}} or perhaps drop them (I'd prefer to queue). 3. When we've exceeded the high water mark, we can disable the reading incoming messages from the same peer (achievable by disabiling auto read for the channel). This would prevent the current node from executing more work on behalf of a peer to which we cannot send any data. Then when the channel drops below the low water mark (and the channel is 'writable'), we re-enable netty auto read on the read channels for the pper. 1 and 2 are reasonably easy to do (and I'll do them asap), but I'd prefer to defer 3 until later as it has a lot of races and other complexities/subtleties I'd like to put off for the scope of this ticket (especially as sockets are not bidirectional yet). Thoughts? Note: items 1 & 2 are significantly simpler than my earlier comments wrt message expiration, so please disregard them for now. > nio MessagingService > -------------------- > > Key: CASSANDRA-8457 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8457 > Project: Cassandra > Issue Type: New Feature > Reporter: Jonathan Ellis > Assignee: Jason Brown > Priority: Minor > Labels: netty, performance > Fix For: 4.x > > > Thread-per-peer (actually two each incoming and outbound) is a big contributor to context switching, especially for larger clusters. Let's look at switching to nio, possibly via Netty. -- This message was sent by Atlassian JIRA (v6.3.15#6346)