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 0AB10C749 for ; Thu, 24 May 2012 01:02:18 +0000 (UTC) Received: (qmail 12099 invoked by uid 500); 24 May 2012 01:02:17 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 12020 invoked by uid 500); 24 May 2012 01:02:17 -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 12011 invoked by uid 99); 24 May 2012 01:02:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 01:02:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of henry@cloudera.com designates 209.85.214.170 as permitted sender) Received: from [209.85.214.170] (HELO mail-ob0-f170.google.com) (209.85.214.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 01:02:11 +0000 Received: by obbuo13 with SMTP id uo13so3213054obb.15 for ; Wed, 23 May 2012 18:01:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=jQqt8yQkXgpbBSDNGSF1FRHaL9RXGux/OrbipQAr2AA=; b=ImaB4vE9ib+BD7cajmrM8WOqje4Ms18GHXT1fE1JChxK9oB/vYZsBgY1TNiCsXjq2r tvNysvgxdcTIfuPNksOxTNlhWI8BaX7gjjWJkv2xFpx62RPkEc8bhyJtRcV6UP//OvMe bopd3oFjyCuNok8OPwgv9UYGe0Cm1aW/VPO2vyQsu64BHz2NJuH6CzzKZZ1+UrmPDgWt 7R9lR2Zsz/cFBhE/7UvaNVCsbCKhXocDrFScSFpOy08ocRjy4Kjp+EhshoQ48IMZwr3q qFn04Jbd2Szq4RHwY+b2G9QkTo2qoZUxZBunBPv1XqCstAWr2ydO3f5RuASTyW2hsl0O rt/Q== Received: by 10.60.9.170 with SMTP id a10mr28608063oeb.14.1337821309941; Wed, 23 May 2012 18:01:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.35.132 with HTTP; Wed, 23 May 2012 18:01:29 -0700 (PDT) In-Reply-To: References: From: Henry Robinson Date: Wed, 23 May 2012 18:01:29 -0700 Message-ID: Subject: Re: ZooKeeper's resident set size grows but does not shrink To: user@zookeeper.apache.org Cc: Brian Oki Content-Type: multipart/alternative; boundary=e89a8fb1edf8f3b88e04c0bdcb14 X-Gm-Message-State: ALoCoQng6bI+qdZaKSSVuxfbDmc2gbCR1AK7xlZZfR6Lm/sPVOn/97FAIRzfDk9T3NP2II8pyb2f --e89a8fb1edf8f3b88e04c0bdcb14 Content-Type: text/plain; charset=ISO-8859-1 Although the amount of Java heap that ZK might be using may go down, the JVM process will still hang on to the physical memory allocated for it and if there is no external pressure from other processes Linux will not need to swap it to disk, hence the RSS will remain roughly constant. That is, the amount of 'real' memory used by a JVM doesn't tell you how much of the JVM's heap is being used. If you believe that the heap usage by ZK is too high, because GC is not finding enough free objects to return to the heap, then that will cause a problem because if you ever do have memory pressure then ZK will start swapping, which is bad. In general, processes on Linux don't usually give memory back - they use as much as they need concurrently, and then the operating system eventually swaps out the unused pages if it needs to. Can you paste the output of jmap -heap into a reply? That will allow us to see how much of the heap is really being used. Thanks, Henry On 23 May 2012 17:41, Brian Oki wrote: > Hello, > > We use ZooKeeper 3.3.3. On a 3-node site, we've been using Patrick Hunt's > publicly available latencies test suite to create scenarios that will help > us to understand the memory, CPU and disk requirements for a deployment of > ZooKeeper for our type of workload. We use a fourth node as the ZooKeeper > (ZK) client to conduct the tests. > > We modified zk-latencies.py slightly to just create-set-delete znodes only. > In particular, we create 1000 permanent znodes, each written with 250,000 > bytes of data. We do this create-set-delete in a loop, sleeping for 5 > seconds between iterations. > > We observe at the ZK leader that the Resident Set Size (RSS) memory climbs > rapidly to 2.6 GB on an 8 GB RAM node. The Java heap size of each ZK > server daemon is 3 GB. > > Further, once the test has gone through 15 iterations, all the znodes > created on behalf of the test have been deleted. There is no further write > activity to ZK, and no read activity at all. The system is quiesced. No > other services are competing for the disk, CPU or RAM during the test. > > Our question is this: The RSS of the ZK leader (and the followers) seems to > remain at 2.6 GB after the test has completed. Why? > > We would expect that since all relevant znodes for the test have been > deleted, the leader's RSS should have shrunk considerably, even after 1 > hour has passed. Are we missing something? > > We have used jmap to inspect the heap. To understand the heap contents > requires detailed implementation knowledge that we don't have, so we didn't > pursue this avenue any further. > > Configuration: > 3 node servers running ZK daemons as 3-server ensemble > 1 client machine > each node has 8 GB RAM > each node has 4 cores > each node has a 465 GB disk > ZK release: 3.3.3 > ZK server java heap size: 3 GB > GC: concurrent low-pause garbage collector > NIC: bonded 1 Gb NIC > > Thank you. > > Sincerely, > > Brian > -- Henry Robinson Software Engineer Cloudera 415-994-6679 --e89a8fb1edf8f3b88e04c0bdcb14--