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 3A4A96424 for ; Mon, 13 Jun 2011 17:40:25 +0000 (UTC) Received: (qmail 66793 invoked by uid 500); 13 Jun 2011 17:40:24 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 66764 invoked by uid 500); 13 Jun 2011 17:40:24 -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 66756 invoked by uid 99); 13 Jun 2011 17:40:24 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 17:40:24 +0000 Received: from localhost (HELO mail-fx0-f42.google.com) (127.0.0.1) (smtp-auth username camille, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 17:40:24 +0000 Received: by fxm1 with SMTP id 1so3336973fxm.15 for ; Mon, 13 Jun 2011 10:40:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.9.137 with SMTP id l9mr3530362fal.25.1307986822736; Mon, 13 Jun 2011 10:40:22 -0700 (PDT) Received: by 10.223.101.203 with HTTP; Mon, 13 Jun 2011 10:40:22 -0700 (PDT) Received: by 10.223.101.203 with HTTP; Mon, 13 Jun 2011 10:40:22 -0700 (PDT) In-Reply-To: <69D3016305F9084FBD2C4A0DF189BD5C176CE33D13@GSCMAMP02EX.firmwide.corp.gs.com> References: <7DA4B654C7FEB24C9998EE4867BEE93EB9EC6D@CNMAIL12.cn.utstarcom.com> <7DA4B654C7FEB24C9998EE4867BEE93EB9EC83@CNMAIL12.cn.utstarcom.com> <69D3016305F9084FBD2C4A0DF189BD5C176CE33D13@GSCMAMP02EX.firmwide.corp.gs.com> Date: Mon, 13 Jun 2011 13:40:22 -0400 Message-ID: Subject: Re: RE: swap From: Camille Fournier To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001517476200f0aa5404a59b6905 --001517476200f0aa5404a59b6905 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable To add on to this, you know how much memory your vm can allocate, you know how much memory your system has. You shouldn't allocate more memory to the zk vm than the system has minus a percentage for overhead. If you don't hav= e enough space on the machine to run zk without swapping, the machine is too small for your use case. On Jun 13, 2011 9:38 AM, "Fournier, Camille F." wrote: > My advice is to turn off disk swap completely if you are using the machin= e to run only ZK, or any app which should always have its entire heap in memory. Disk swapping by java heaps is very, very bad for apps with performance driven by caching all state. You will need to leave some amount of memory for OS overhead (it's been too long since I did that analysis but I would make sure it is at least in the neighborhood of 10% of the total available memory). > > C > > -----Original Message----- > From: Donna Li [mailto:donna.li@utstar.com] > Sent: Monday, June 13, 2011 3:09 AM > To: user@zookeeper.apache.org > Subject: =B4=F0=B8=B4: swap > > Thanks ted. > I want to know the relation between java heap size and swap. Zookeeper physical memory is enough, but swap is used by 302064k. Should I increase m= y java heap size or decrease my java heap size? > > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Ted Dunning [mailto:ted.dunning@gmail.com] > =B7=A2=CB=CD=CA=B1=BC=E4: 2011=C4=EA6=D4=C213=C8=D5 14:33 > =CA=D5=BC=FE=C8=CB: user@zookeeper.apache.org > =D6=F7=CC=E2: Re: swap > > This sounds like a question with a story behind it. > > Do you mean that your ZK server filled up all of memory and caused the > machine to start swapping? > > If that is your problem, then there really is no fix other than to not > do that. The reason is that Zookeeper is memory based so if you don't > have enough memory, either because you are over-filling Zookeeper or > have insufficient memory, then things aren't going to work. > > Turning off swap may be one of the worst things to do in this case > since the machine will tend to fail harder instead of just getting > very slow. That can make recovery more difficult. > > On Mon, Jun 13, 2011 at 5:52 AM, Donna Li wrote: >> >> Hi, all: >> How to avoid swap on zookeeper server? >> >> Best Regards >> Donna li >> --001517476200f0aa5404a59b6905--