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 1252F200BEB for ; Wed, 28 Dec 2016 17:33:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 10C55160B2E; Wed, 28 Dec 2016 16:33:05 +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 5A72B160B2A for ; Wed, 28 Dec 2016 17:33:04 +0100 (CET) Received: (qmail 73152 invoked by uid 500); 28 Dec 2016 16:32:58 -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 73141 invoked by uid 99); 28 Dec 2016 16:32:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2016 16:32:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 599AC2C1F56 for ; Wed, 28 Dec 2016 16:32:58 +0000 (UTC) Date: Wed, 28 Dec 2016 16:32:58 +0000 (UTC) From: "Corentin Chary (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-13039) Mutation time mostly spent in LinkedBlockingQueue.put() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 28 Dec 2016 16:33:05 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15783227#comment-15783227 ] Corentin Chary commented on CASSANDRA-13039: -------------------------------------------- That would make sense when using QUORUM (because you are waiting for these replicated mutation). If you use ONE it's the opposite. I'm still trying to build a cassandra stress profile that can easilly reproduce that. > Mutation time mostly spent in LinkedBlockingQueue.put() > ------------------------------------------------------- > > Key: CASSANDRA-13039 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13039 > Project: Cassandra > Issue Type: Bug > Components: Coordination > Reporter: Corentin Chary > Attachments: mutation-linkedlist-block.png, profiler-snapshot.nps > > > On a setup with a sustained write load of 70kQPS per node and a RF of 2 it looks like most of the mutation time is spend in OutboundTcpConnection.enqueue() -> backlog.put() > backlog is an unbounded LinkedBlockingQueue, which means that .put() can only be blocking if a lock is taken. I strongly suspect that this is caused by the use of drainTo() in CoalescingStrategies which is causing contention for the producers. > On the other hand, not using drainTo() could lead to starvation of the consumers. > Possible solutions: > - Allow multiple connections per size and per hosts in OutboundTcpConnectionPool > - Switch from drainTo to multiple take() > - Switch to ConcurrentLinkedQueue (which is lockless), also means we need active polling. > Maybe a good solution would be something hybrid: a bounded LinkedBlockingQueue and an unbounded ConcurrentLinkedQueue. This way you get low latency when you don't have a lot of messages, and throughput when you do. -- This message was sent by Atlassian JIRA (v6.3.4#6332)