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 5E0A8200C7C for ; Mon, 5 Jun 2017 22:40:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5C893160BD4; Mon, 5 Jun 2017 20:40:44 +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 2A69C160BBB for ; Mon, 5 Jun 2017 22:40:42 +0200 (CEST) Received: (qmail 94198 invoked by uid 500); 5 Jun 2017 20:37:53 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 94183 invoked by uid 99); 5 Jun 2017 20:37:51 -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; Mon, 05 Jun 2017 20:37:51 +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 66532C0040 for ; Mon, 5 Jun 2017 20:37:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id WQNo84iaU6Th for ; Mon, 5 Jun 2017 20:37:48 +0000 (UTC) Received: from mx0b-0019e102.pphosted.com (mx0b-0019e102.pphosted.com [67.231.157.237]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7EF795F5B9 for ; Mon, 5 Jun 2017 20:37:47 +0000 (UTC) Received: from pps.filterd (m0074414.ppops.net [127.0.0.1]) by mx0b-0019e102.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v55KVeps030451 for ; Mon, 5 Jun 2017 15:37:40 -0500 Received: from mail-ot0-f199.google.com (mail-ot0-f199.google.com [74.125.82.199]) by mx0b-0019e102.pphosted.com with ESMTP id 2avs21twm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 05 Jun 2017 15:37:40 -0500 Received: by mail-ot0-f199.google.com with SMTP id w41so2697597otw.8 for ; Mon, 05 Jun 2017 13:37:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Dx97yw+APsERr26snWrJVrjcmWX77/aw7cbZ7MCvKA0=; b=M4+6CKjf6o/8/5FacjvYqL/BufrSe+kt/OJAK7i/D8+5xlDHo+/4RV2m7PGSkgQMWu fhQOyo5nNh3UDpD+tmEWuxzHsE+F77NQSPgGf0FMCdUuiNrmibrzcFR2E3OkrmSCm6tn NNG7jUZXsfn86gMquQkb7cIOmoUGyOAX9asr+C1gpoDBcfUl6hu06zCVb4ESSH594Lj7 75gz6CHAnUZ/vcgJuHNqy+VinQ2KD0+RrVtH7EFJsoSnr5u/Y1Osvt0yvrvIYppXNT4V /G9LNL/WAE/uXrVrn10IjjB4RdV7yIwV6XIyXlsjlEoBBEmyM18i7bargNLtAMcvn+cF 9qyA== X-Gm-Message-State: AODbwcDCWDl8uAFWobWlMnN5mwjSqrzcmXA8IbmBEwvvdaPIjXhC2vK4 fQdptttM8HmKOSUjLdP8vvLK2np1R5powNzKAcZlV+qxF2bBdbsNbHB5z/wUPqIb+ntku0BgF25 I7lt4P0ZQxbCO/XouBxDtMuU= X-Received: by 10.202.232.143 with SMTP id f137mr10543414oih.33.1496695059384; Mon, 05 Jun 2017 13:37:39 -0700 (PDT) X-Received: by 10.202.232.143 with SMTP id f137mr10543407oih.33.1496695059165; Mon, 05 Jun 2017 13:37:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.227.148 with HTTP; Mon, 5 Jun 2017 13:37:08 -0700 (PDT) In-Reply-To: <48EA6CCB-267D-4A64-A43E-5703A0BDCF1A@apache.org> References: <48EA6CCB-267D-4A64-A43E-5703A0BDCF1A@apache.org> From: Phil May Date: Mon, 5 Jun 2017 15:37:08 -0500 Message-ID: Subject: Re: Cluster Replication batch_size and batch_count Modification To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary="001a1141c70656c94f05513c796c" X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706050389 archived-at: Mon, 05 Jun 2017 20:40:44 -0000 --001a1141c70656c94f05513c796c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Adam, Thanks for the info! When we run at high write rates, we will start to fall behind, but when we reduce the rate, we eventually catch up. I have a clarification question =E2=80=93 can the warning messages we are s= eeing still occur in a healthy cluster due to the "redundant cross-check" taking long enough that more changes have accumulated that now also need to be cross-checked (even when no actual writes were needed)? We have had some luck modifying sync_concurrency (which is exposed in the .ini file) and batch_size (which we exposed), and that does give us more throughput capacity. Thanks! - Phil On Mon, Jun 5, 2017 at 11:38 AM, Adam Kocoloski wrote= : > Hi Phil, > > Here=E2=80=99s the thing to keep in mind about those warning messages: in= a > healthy cluster, the internal replication traffic that generates them is > really just a redundant cross-check. It exists to =E2=80=9Cheal=E2=80=9D = a cluster member > that was down during some write operations. When you write data into a > CouchDB cluster the copies are written to all relevant shard replicas > proactively. > > If your cluster=E2=80=99s steady-state write load is causing internal clu= ster > replication to fall behind permanently, that=E2=80=99s problematic. You s= hould tune > the cluster replication parameters to give it more throughput. If the > replication is only falling behind during some batch data load and then > catches up later it may be a different story. You may want to keep things > configured as-is. > > Does that make sense? > > Cheers, Adam > > > On Jun 4, 2017, at 11:06 PM, Phil May > wrote: > > > > I'm writing to check whether modifying replication batch_count and > > batch_size parameters for cluster replication is good idea. > > > > Some background =E2=80=93 our data platform dev team noticed that under= heavy > write > > load, cluster replication was falling behind. The following warning > > messages started appearing in the logs, and the pending_changes value > > consistently increased while under load. > > > > [warning] 2017-05-18T20:15:22.320498Z couch-1@couch-1.couchdb <0.316.0> > > -------- mem3_sync shards/a0000000-bfffffff/test.1495137986 > > couch-3@couch-3.couchdb > > {pending_changes,474} > > > > What we saw is described in COUCHDB-3421 > > . In addition, > CouchDB > > appears to be CPU bound while this is occurring, not I/O bound as would > > seem reasonable to expect for replication. > > > > When we looked into this, we discovered in the source two values > affecting > > replication, batch_size and batch_count. For cluster replication, these > > values are fixed at 100 and 1 respectively, so we made them configurabl= e. > > We tried various values and it seems increasing the batch_size (and to = a > > lesser extent) batch_count improves our write performance. As a point o= f > > reference, with batch_count=3D50 and batch_size=3D5000 we can handle ab= out > > double the write throughput with no warnings. We are experimenting with > > other values. > > > > We wanted to know if adjusting these parameters is a sound approach. > > > > Thanks! > > > > - Phil > > --001a1141c70656c94f05513c796c--