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 0A58C17384 for ; Thu, 16 Apr 2015 21:16:32 +0000 (UTC) Received: (qmail 5202 invoked by uid 500); 16 Apr 2015 21:16:31 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 5152 invoked by uid 500); 16 Apr 2015 21:16:31 -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 5141 invoked by uid 99); 16 Apr 2015 21:16:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2015 21:16:31 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Dejan.Markic@mobik-ics.com designates 213.142.225.16 as permitted sender) Received: from [213.142.225.16] (HELO ALICE.main.mobik.si) (213.142.225.16) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2015 21:16:05 +0000 From: Dejan Markic To: Flavio Junqueira CC: "user@zookeeper.apache.org" Subject: RE: Transaction logs and snapshots Thread-Topic: Transaction logs and snapshots Thread-Index: AdB4G6FCq9oG8TjcQ1iHjWKrxUAknP//8s0A///b9YCAAC2VAP//3URQgADVp4CAACykjg== Date: Thu, 16 Apr 2015 21:15:38 +0000 Message-ID: <1458C6B4EF2B37428F20085D75DD94DB0179DF4039@MARY.main.mobik.si> References: <1458C6B4EF2B37428F20085D75DD94DB0179DE3F9B@MARY.main.mobik.si> <1052245806.5125456.1429177740571.JavaMail.yahoo@mail.yahoo.com> <1458C6B4EF2B37428F20085D75DD94DB0179DE4369@MARY.main.mobik.si>,<6F73A35C-6BF8-4B32-9BD6-0B46D3449BD3@yahoo.com> In-Reply-To: <6F73A35C-6BF8-4B32-9BD6-0B46D3449BD3@yahoo.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.77.104.36] x-esetresult: clean, is OK x-esetid: C6A47E238B56557D90E02F Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hello Flavio!=0A= =0A= Yes, indeed, ZK might not be the best option - but I could not find any bet= ter. What we need is a rather fast, distributed locking "system". ZK was at= the moment the best option, and after testing it seemed to be the thing we= are looking for. Other than snapshots/transaction logs, we have no problem= s. It easily handles our current load. It has C library, which makes it fai= rly easy to port it to other software.=0A= What we need (but I cannot find any) is distributed in-memory distributed l= ocking system where we can store some small information. =0A= For instance, we use ZK's nodes as /SESSION_ID ... we lock it here, and the= n we use eg /SESSION_ID/my_var to store something. After session is gone, w= e remove this node and all information about it.=0A= =0A= If you have any idea about what kind of software we should try, please let = me know. You've helped me enough already!=0A= =0A= Thank you and kind regards,=0A= Dejan Markic=0A= ________________________________________=0A= From: Flavio Junqueira [fpjunqueira@yahoo.com]=0A= Sent: Thursday, April 16, 2015 10:29 PM=0A= To: Dejan Markic=0A= Cc: user@zookeeper.apache.org=0A= Subject: Re: Transaction logs and snapshots=0A= =0A= Another think you could do is to make snapCount very large so that snapshot= s are created infrequently. But, let me step back and ask you why you think= ZK is a good fit for your project. It isn't clear to me that your case is = a good one for ZK.=0A= =0A= -Flavio=0A= =0A= =0A= > On 16 Apr 2015, at 11:01, Dejan Markic wrote= :=0A= >=0A= > Hello!=0A= >=0A= > Log seems to be always 67.108.880 bytes.=0A= > Snapshots are currently between 30-40MB. Snapshot is created almost every= minute.=0A= > Yes, data durability is not important at all. Once the session ends (it m= ay last between 0 and few minutes, average around 1-2 minutes maybe), I don= 't need it anymore. I regulary remove nodes that are not changed for more = than 10 minutes.=0A= > I even recieve updates for sessions, so even if ZK looses data, I would g= et it back after few minutes.=0A= >=0A= > Thanks!=0A= >=0A= > Kind regards,=0A= > Dejan=0A= >=0A= >=0A= > -----Original Message-----=0A= > From: Flavio Junqueira [mailto:fpjunqueira@yahoo.com.INVALID]=0A= > Sent: Thursday, April 16, 2015 11:49 AM=0A= > To: user@zookeeper.apache.org=0A= > Subject: Re: Transaction logs and snapshots=0A= >=0A= > Hi Dejan,=0A= > For a typical ZK application, granularity of hours is more than enough, s= ince it is supposed to be an infrequent background task. In your case, it s= ounds like durability isn't an important property because if it is you shou= ldn't be getting rid of disk data this fast. I'm also wondering about the a= mount of data you're generating. What's the size of your snapshots and txn = logs?=0A= > -Flavio=0A= >=0A= >=0A= > On Thursday, April 16, 2015 10:26 AM, Dejan Markic wrote:=0A= >=0A= >=0A= >=0A= > Hello Flavio!=0A= >=0A= > Would that mean, that zkCleanup.sh would not be needed?=0A= > PurgeInterval is minimum 1 hour? Why is it so high?=0A= >=0A= > Thanks!=0A= >=0A= > Kind regards,=0A= > Dejan Markic=0A= >=0A= >=0A= > -----Original Message-----=0A= > From: Flavio Junqueira [mailto:fpjunqueira@yahoo.com.INVALID]=0A= > Sent: Thursday, April 16, 2015 11:15 AM=0A= > To: user@zookeeper.apache.org=0A= > Subject: Re: Transaction logs and snapshots=0A= >=0A= > Hi Dejan,=0A= > Check if the autopurge feature solves your problem:=0A= > http://zookeeper.apache.org/doc/r3.4.6/zookeeperAdmin.html#sc_advancedCon= figuration=0A= >=0A= > -Flavio=0A= >=0A= >=0A= > On Thursday, April 16, 2015 9:17 AM, Dejan Markic wrote:=0A= >=0A= >=0A= >=0A= > Hello all!=0A= >=0A= > We are running 3 ZK servers in ensemble, and ZK is processing a lot of co= mmands per seconds. There are probably around 300 nodes created/checked/set= /get per second.=0A= > Since we have only information about live sessions we handle in ZK, we do= n't need any data persistency - eg: we can stop all nodes, clean all transa= ction logs/snapshots, and start them up again, without any issues.=0A= > Since we have a lot of requests/changes, we have moved dataDir onto ramdi= sk, so we have no problems with disk IOPS, etc.=0A= > Is there a way, to minimze the usage of snapshots/logs so ramdisk would n= ot get filled up? It happens that transaction logs/snapshots grow so large,= that we run out of space on ramdisk.=0A= > We issue >/usr/share/zookeeper/bin/zkCleanup.sh -n 3< every 2 minutes, so= this should cleanup the dataDir quite often. Why is >count number of snaps= hots/logs to keep< limited to 3 and not below?=0A= > I assume, in my setup, I don't even need snapshots/logs to be stored afte= r they are not actively needed?=0A= > So my basic questions are:=0A= > - can I somehow get rid of snapshot/logs sooner, more often ... ?=0A= > - when is snapshot created? Can it be created sooner, so it would be smal= ler?=0A= > - Is it possible to get rid of snapshot/logs all together?=0A= >=0A= > Thank you for all your inputs and kind regards, Dejan Markic=0A= >=0A= >=0A= >=0A= >=0A= >=0A= >=0A= >=0A= =0A=