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 9E108200C4E for ; Wed, 22 Mar 2017 20:58:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9AE23160B86; Wed, 22 Mar 2017 19:58: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 E80E4160B91 for ; Wed, 22 Mar 2017 20:58:47 +0100 (CET) Received: (qmail 99000 invoked by uid 500); 22 Mar 2017 19:58:46 -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 98937 invoked by uid 99); 22 Mar 2017 19:58:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Mar 2017 19:58:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 6C9DD181327 for ; Wed, 22 Mar 2017 19:58:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.549 X-Spam-Level: X-Spam-Status: No, score=-98.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hotRGp1BbZ9R for ; Wed, 22 Mar 2017 19:58:44 +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 EA48E5FDA6 for ; Wed, 22 Mar 2017 19:58:43 +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 B2338E0BD5 for ; Wed, 22 Mar 2017 19:58:42 +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 F1A4D254F0 for ; Wed, 22 Mar 2017 19:58:41 +0000 (UTC) Date: Wed, 22 Mar 2017 19:58:41 +0000 (UTC) From: "Shannon Carey (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6908) Dynamic endpoint snitch destabilizes cluster under heavy load MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 22 Mar 2017 19:58:48 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-6908?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 15937013#comment-15937013 ]=20 Shannon Carey commented on CASSANDRA-6908: ------------------------------------------ It looks like I've run into this issue too: http://www.mail-archive.com/use= r@cassandra.apache.org/msg51510.html My cluster was not under particularly heavy load, although there was higher= read load in the local DC than the remote DC. Not enough load that the loc= al latency was higher than remote, but the snitch apparently started routin= g my requests to the remote DC anyway (though I cannot verify that via the = metrics). > Dynamic endpoint snitch destabilizes cluster under heavy load > ------------------------------------------------------------- > > Key: CASSANDRA-6908 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6908 > Project: Cassandra > Issue Type: Improvement > Components: Configuration > Reporter: Bart=C5=82omiej Roma=C5=84ski > Assignee: Brandon Williams > Attachments: as-dynamic-snitch-disabled.png > > > We observe that with dynamic snitch disabled our cluster is much more sta= ble than with dynamic snitch enabled. > We've got a 15 nodes cluster with pretty strong machines (2xE5-2620, 64 G= B RAM, 2x480 GB SSD). We mostly do reads (about 300k/s). > We use Astyanax on client side with TOKEN_AWARE option enabled. It automa= tically direct read queries to one of the nodes responsible the given token= . > In that case with dynamic snitch disabled Cassandra always handles read l= ocally. With dynamic snitch enabled Cassandra very often decides to proxy t= he read to some other node. This causes much higher CPU usage and produces = much more garbage what results in more often GC pauses (young generation fi= lls up quicker). By "much higher" and "much more" I mean 1.5-2x. > I'm aware that higher dynamic_snitch_badness_threshold value should solve= that issue. The default value is 0.1. I've looked at scores exposed in JMX= and the problem is that our values seemed to be completely random. They ar= e between usually 0.5 and 2.0, but changes randomly every time I hit refres= h. > Of course, I can set dynamic_snitch_badness_threshold to 5.0 or something= like that, but the result will be similar to simply disabling the dynamic = switch at all (that's what we done). > I've tried to understand what's the logic behind these scores and I'm not= sure if I get the idea... > It's a sum (without any multipliers) of two components: > - ratio of recent given node latency to recent average node latency > - something called 'severity', what, if I analyzed the code correctly, is= a result of BackgroundActivityMonitor.getIOWait() - it's a ratio of "iowai= t" CPU time to the whole CPU time as reported in /proc/stats (the ratio is = multiplied by 100) > In our case the second value is something around 0-2% but varies quite he= avily every second. > What's the idea behind simply adding this two values without any multipli= ers (e.g the second one is in percentage while the first one is not)? Are w= e sure this is the best possible way of calculating the final score? > Is there a way too force Cassandra to use (much) longer samples? In our c= ase we probably need that to get stable values. The 'severity' is calculate= d for each second. The mean latency is calculated based on some magic, hard= coded values (ALPHA =3D 0.75, WINDOW_SIZE =3D 100).=20 > Am I right that there's no way to tune that without hacking the code? > I'm aware that there's dynamic_snitch_update_interval_in_ms property in t= he config file, but that only determines how often the scores are recalcula= ted not how long samples are taken. Is that correct? > To sum up, It would be really nice to have more control over dynamic snit= ch behavior or at least have the official option to disable it described in= the default config file (it took me some time to discover that we can just= disable it instead of hacking with dynamic_snitch_badness_threshold=3D1000= ). > Currently for some scenarios (like ours - optimized cluster, token aware = client, heavy load) it causes more harm than good. -- This message was sent by Atlassian JIRA (v6.3.15#6346)