Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C81D18D76 for ; Fri, 18 Mar 2016 16:48:53 +0000 (UTC) Received: (qmail 4981 invoked by uid 500); 18 Mar 2016 16:48:52 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 4933 invoked by uid 500); 18 Mar 2016 16:48:52 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 3730 invoked by uid 99); 18 Mar 2016 16:48:46 -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; Fri, 18 Mar 2016 16:48:46 +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 493611804FC for ; Fri, 18 Mar 2016 16:48:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-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 rskvKbE_c52b for ; Fri, 18 Mar 2016 16:48:44 +0000 (UTC) Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 601B65F241 for ; Fri, 18 Mar 2016 16:48:44 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id a36so73133646qge.0 for ; Fri, 18 Mar 2016 09:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=extH6jd+CsL4PNWmtvcgnlb43ChPyKl2tdxAzL+9r/4=; b=CoYsZoEYTZEcdYhHLv7u/3Q8ViFbfYJFftK9iUQw9jm7Vr4WI2qN/vcoNDddoQTa4r h7x0p2AAjCLW6a2Ov1AJgchrxrgY8HjM68SHZVkIwnYeCogW94wZ1g/j6oP3yM6PoGgE ziF/Q8KE6dgpkCLhwDm4XeUZipjkPNnASzn23Hj5Tch/tEj1RFftZKk9p5yhwk5QrTyf o8QAFrHyRb9KCwFpRgsDYPN313tHyo+9rkpuGjBNNw0gGI5Hwc5ee30elZ3RqxQG/u9V CR0oGzDNMTFq8rBAON2yfyKIupLBdjyJd1HYTRgBdVyX3WBVVqR17/qefSrCAdXwjXju lyBw== 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; bh=extH6jd+CsL4PNWmtvcgnlb43ChPyKl2tdxAzL+9r/4=; b=JmN0xj3tLFrgWx3mBPiBulP45IZ09ZzCI5gPsDZ8pscL6k0XUU7NrbvM9/RHLkmDnJ GZmtmqraBxVTGZuqBWpDi7TX9+OzlTylZYAFrNDf7ChEjyzri/NyyBzOTuJkN5tKL/mz QC+vt0gpFvUa8c6IQAyp/+CF97sgzOXhQO4PA6LBH5LNVCHVgN+MlOexWKCvw01S0Js3 AeuN68OLl+l2SG/zpPRH3L9cimoxIW8TzTVhKQYo1aeTWQCtKSRceCcdqqAPg/6Fww1L PHkceguwGpVzbFdBeKifXbT8w8JkZVd0HyUuHJ0WwqIZ7TkyzWJLBzdf34qMRs/MYdn9 EwhA== X-Gm-Message-State: AD7BkJIuoWwsIcHQS+EEac2nIhoE9mpSLuEyhQNiOKRu6RoWP871lpnb8rEh0lZMMcwlsgZo/yGMoKBLKBor6Q== MIME-Version: 1.0 X-Received: by 10.140.91.35 with SMTP id y32mr23304072qgd.42.1458319723885; Fri, 18 Mar 2016 09:48:43 -0700 (PDT) Received: by 10.140.93.11 with HTTP; Fri, 18 Mar 2016 09:48:43 -0700 (PDT) In-Reply-To: References: Date: Fri, 18 Mar 2016 16:48:43 +0000 Message-ID: Subject: Re: Dealing with old delivered requests in memory From: ibrahim El-sanosi To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001a113957521c7dac052e558544 --001a113957521c7dac052e558544 Content-Type: text/plain; charset=UTF-8 Thank you Jordan, So as "ZooKeeper stores the entire database in memory. ZNodes exist until deleted.". As we know the memory size is limited, we expect the OutOfMemoryError excption could occur even we set the Max heap size as maxumim value as possible? Ibrahim On Fri, Mar 18, 2016 at 4:40 PM, Jordan Zimmerman < jordan@jordanzimmerman.com> wrote: > ZooKeeper stores the entire database in memory. Logs are for durability > only. ZNodes exist until deleted. > > -Jordan > > > On Mar 18, 2016, at 11:38 AM, ibrahim El-sanosi < > ibrahimsabattt@gmail.com> wrote: > > > > Thank you for replaying. > > > > > > Take this example, Zookeeper started on 1/1/2015, and assume ZK servers > are > > never crashed. Also, the ZK are very busy, reciveing continusly write > > requests from clients and accordingly snapshots are generated overtime. > On > > 1/3/2015, what Znodes will be in memory data tree? do all Znodes still > > store in memory (from 1/1/2015 to 1/3/2015) as there is no crashed occur. > > Or Dsnapshhot is taken the data tree is > > > > > > Note that I am not asking about data in log or snapshoot. I am asking > > about the current data in memory. > > > > On Fri, Mar 18, 2016 at 4:12 PM, Flavio Junqueira > wrote: > > > >> Hi Ibrahim, > >> > >> Are you asking about how we compact old logs? We do it by taking > snapshots > >> so that upon recovery, we only load the latest snapshot and replay the > txn > >> log from the snapshot tag. The snapshot tag is the last zxid committed > when > >> we start producing the snapshot. > >> > >> We don't actually delete anything, though, unless you intentionally turn > >> on auto purge: > >> > >> > https://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#sc_administering > >> < > >> > https://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#sc_administering > >>> > >> > >> -Flavio > >> > >>> On 18 Mar 2016, at 16:05, ibrahim El-sanosi > >> wrote: > >>> > >>> Hi all, > >>> > >>> Assume the Zookeeper have been running for about one year (from > 1/1/2015 > >>> until now), how does ZooKeeper deal with old delivered write requests > (To > >>> optimize a memory used) (say from 1/1/2015 to 03/04/2015). I am > assuming > >>> the old delivered request are no longer used. > >>> > >>> On the other words, what strategy ZK does to find and delete unused > >> Znodes? > >>> > >>> Ibrahim > >> > >> > > --001a113957521c7dac052e558544--