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 5AC5E200AC5 for ; Sun, 5 Jun 2016 22:53:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 594F4160A28; Sun, 5 Jun 2016 20:53:39 +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 79508160A25 for ; Sun, 5 Jun 2016 22:53:38 +0200 (CEST) Received: (qmail 89381 invoked by uid 500); 5 Jun 2016 20:53:37 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 89369 invoked by uid 99); 5 Jun 2016 20:53:37 -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; Sun, 05 Jun 2016 20:53:37 +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 B617E180536 for ; Sun, 5 Jun 2016 20:53:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.721 X-Spam-Level: X-Spam-Status: No, score=-0.721 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=confluent-io.20150623.gappssmtp.com 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 I86Bv1pX8-tO for ; Sun, 5 Jun 2016 20:53:34 +0000 (UTC) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 594745F2F0 for ; Sun, 5 Jun 2016 20:53:34 +0000 (UTC) Received: by mail-it0-f45.google.com with SMTP id z123so29100461itg.0 for ; Sun, 05 Jun 2016 13:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=confluent-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-transfer-encoding; bh=xSwX473t0Wea2VsFPvt9A+5lO7/HsXo5wRQDYjXWTuA=; b=TonHb/dVEhXKRAPWKsluDw0zCfIqqGWqOIl5kT6kYXI3ujgrbSSoOpYqmBwoGn3lhD iOmMlT98tUJbbNhZqHE1qUjml+klCT3LQBDIT4uxpPpjYdxc9On4zquXJZ6haUSCS++K p1kAFa9Tf4ga/8lxB9ecLN7j59UlkFHkyPFWVMA+T76tgHo/CR0PLF92woHSqQ+IxH1J W5X+x3kNNkmjjit1fPEdAXq+aBK5YtARXiU5rR//1Vupf/4wejg6EbOphUS99PLRilFL v2W57HSLvBkJGQt2r1K4evI4DsLQCJWtw2lZaaU+gY2oKKOR6TFGLy4ubXkYv+QWyV5c yGZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-transfer-encoding; bh=xSwX473t0Wea2VsFPvt9A+5lO7/HsXo5wRQDYjXWTuA=; b=VVDWVN6FHeRavc699oWEDDERf17e1Ah5ksQihOuvlzVa4iiS7ecQYaTiEynC1UKfdf pAB9h06dbXqapMrXPch83hbipR74BzM1t7kxQgPaBOTXKQTx90pMamO20omVy3Jl9KPM 0N5zVYT3Xwq4B8o/wuOR3u2YcJluFifYf6hFeTg0N1cgQR9i+dI58+SYrhmzPSZ7ibhk Y+5y7u2S5AVlYbRblVzRx/LKjlGQ7phRBuqHKhsxAmKgIaQt3Q5602C6OV6pFTl+elmb Lr9VhsVB4s54Ar+DcbVmV028igjZEz2KpIIefPOh3mkkyg+WXCmI2Ui2vEARRcNCREwE ouuA== X-Gm-Message-State: ALyK8tId6O4/2IhRPZKpnvEr+A5aflwViveyGpD7FEhfmZWECNyV5sIOABDXK2GBXWmWu+6qf6joPz8tHMJIeg== MIME-Version: 1.0 X-Received: by 10.36.47.136 with SMTP id j130mr12572435itj.48.1465160013242; Sun, 05 Jun 2016 13:53:33 -0700 (PDT) Received: by 10.64.33.47 with HTTP; Sun, 5 Jun 2016 13:53:33 -0700 (PDT) In-Reply-To: References: <4EAE047E-7583-455E-85B1-B880F94C767C@gmail.com> <03513734-670A-4F72-B324-BAC9858EBC34@gmail.com> Date: Sun, 5 Jun 2016 23:53:33 +0300 Message-ID: Subject: Re: [DISCUSS] KIP-63: Unify store and downstream caching in streams From: Gwen Shapira To: dev@kafka.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Sun, 05 Jun 2016 20:53:39 -0000 So you were listing the difficulties in order to provide context for the upcoming design change and discussion? Its all good then :) On Sun, Jun 5, 2016 at 11:26 PM, Guozhang Wang wrote: > Don't get me wrong Gwen :) I'm definitely for removing as less burden as > possible from users. All I'm saying it is not straight-forward to do so, > and we'd better at least have a concrete implementation design on the KIP > page rather than just a one-line change of the config semantics. > > On Sun, Jun 5, 2016 at 1:09 PM, Gwen Shapira wrote: > >> If it is hard for you, just imagine how much fun the users will have. >> >> Machines have X GB available RAM. Someone has to figure out how to >> divide it for processors and rocksDB. The user doesn't have any >> special knowledge that you don't in this case, so there's no point in >> pushing the decision to the user - he won't be able to make a better >> decision. >> >> Gwen >> >> On Sun, Jun 5, 2016 at 10:44 PM, Guozhang Wang wrot= e: >> > There are some details needed to be figured out if we go global: >> > >> > A KafkaStreams instance could have M threads, and each thread could >> various >> > number (let's say N, but in practice it may be different from thread t= o >> > thread) tasks, and each task contains a sub-topology with P caches (ag= ain >> > in practice it may be different depending on which sub-topology it >> > contains). >> > >> > Say if user specified X Gb for this KafkaStreams instance, then each >> cache >> > will get X / M / N / P Gb. But remember N and P can change from rebala= nce >> > to rebalance, and threads does not communicate with each other during >> their >> > life time. So it is hard to determine M and N dynamically. >> > >> > Plus, different caches may have different cache hit rate, so distribut= ing >> > the memory evenly to them may not be an optimal solution (some caches = may >> > be flushed much more frequently than others), and also since we are >> > considering to use instrumentation.getObjectSize which is approximate,= it >> > may exaggerate the imbalance. >> > >> > >> > Guozhang >> > >> > >> > On Sat, Jun 4, 2016 at 11:54 PM, Eno Thereska >> > wrote: >> > >> >> Hi Jay, >> >> >> >> We can make it global instead of per-processor, sounds good. >> >> >> >> Thanks >> >> Eno >> >> >> >> >> >> > On 3 Jun 2016, at 23:15, Jay Kreps wrote: >> >> > >> >> > Hey Eno, >> >> > >> >> > Should the config be the global memory use rather than the >> per-processor? >> >> > That is, let=E2=80=99s say I know I have fixed a 1GB heap because t= hat is >> what I >> >> > set for Java, and want to use 100MB for caching, it seems like righ= t >> now >> >> > I=E2=80=99d have to do some math that depends on my knowing a bit a= bout how >> >> caching >> >> > works to figure out how to set that parameter so I don't run out of >> >> memory. >> >> > Does it also depend on the number of partitions assigned (and hence >> the >> >> > number of task), if so that makes it even harder to set since each >> time >> >> > rebalancing happens that changes so it is then pretty hard to set >> safely. >> >> > >> >> > You could theoretically argue for either bottom up (you know how mu= ch >> >> cache >> >> > you need per processor as you have it and you want to get exactly >> that) >> >> or >> >> > top down (you know how much memory you have to spare but can't be >> >> bothered >> >> > to work out what that amounts to per-processor). I think our >> experience >> >> has >> >> > been that 99% of people never change the default and if it runs out= of >> >> > memory they really struggle to fix it and kind of blame us, so I th= ink >> >> top >> >> > down and a global config might be better. :-) >> >> > >> >> > Example: https://issues.apache.org/jira/browse/KAFKA-3775 >> >> > >> >> > -Jay >> >> > >> >> > On Fri, Jun 3, 2016 at 2:39 PM, Eno Thereska >> >> wrote: >> >> > >> >> >> Hi Gwen, >> >> >> >> >> >> Yes. As an example, if cache.max.bytes.buffering set to X, and if >> users >> >> >> have A aggregation operators and T KTable.to() operators, then X*(= A >> + T) >> >> >> total bytes will be allocated for caching. >> >> >> >> >> >> Eno >> >> >> >> >> >>> On 3 Jun 2016, at 21:37, Gwen Shapira wrote: >> >> >>> >> >> >>> Just to clarify: "cache.max.bytes.buffering" is per processor? >> >> >>> >> >> >>> >> >> >>> On Thu, Jun 2, 2016 at 11:30 AM, Eno Thereska < >> eno.thereska@gmail.com> >> >> >> wrote: >> >> >>>> Hi there, >> >> >>>> >> >> >>>> I have created KIP-63: Unify store and downstream caching in >> streams >> >> >>>> >> >> >> >> >> >> https://cwiki.apache.org/confluence/display/KAFKA/KIP-63%3A+Unify+store+= and+downstream+caching+in+streams >> >> >> < >> >> >> >> >> >> https://cwiki.apache.org/confluence/display/KAFKA/KIP-63:+Unify+store+an= d+downstream+caching+in+streams >> >> >>> >> >> >>>> >> >> >>>> >> >> >>>> Feedback is appreciated. >> >> >>>> >> >> >>>> Thank you >> >> >>>> Eno >> >> >> >> >> >> >> >> >> >> >> > >> > >> > -- >> > -- Guozhang >> > > > > -- > -- Guozhang