Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D762A11FB2 for ; Mon, 18 Aug 2014 14:26:11 +0000 (UTC) Received: (qmail 58917 invoked by uid 500); 18 Aug 2014 14:26:11 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 58852 invoked by uid 500); 18 Aug 2014 14:26:11 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 58834 invoked by uid 99); 18 Aug 2014 14:26:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2014 14:26:11 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of vikas.saurabh@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-we0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2014 14:25:45 +0000 Received: by mail-we0-f175.google.com with SMTP id t60so5073844wes.20 for ; Mon, 18 Aug 2014 07:25: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:from:date:message-id:subject:to :content-type; bh=wmSCcM3i7Ha75MZFmUxBrjSlSa12SnB9GVd2Q+iNgS0=; b=WYNHTVNh3gYh1RniHwf9sdp/ioJl0LEEYFlbFJ+ctwSMS62pbGtOCWznrr/GdJdRv2 QTmQK6VsHgbZ5SqEVMLBT7eE/u2QxoTQ7PWwa8GD9cEXt6Bvgpt1OVR/xEk58fn/x/tj YrsTRQ4tw4yldIC9voqpr7aqW9pU5mYbIGNKKAr/Y32yvRd++126Ed/0PBkTlx+86/MA VwKLENDFZC4g0WvVU6pqF+BygnwnFP0pfQwPaZ1kEJ+T0Y6xtaxipZT5T8iv4u0QHA8x UMXVh/c2kX8zeW/cPBnGcdX3egzTK4epS/9rvZacGdtP23X4kvGmxCDBU4yBhKnHVNqI H7NQ== X-Received: by 10.194.175.41 with SMTP id bx9mr3203299wjc.123.1408371944156; Mon, 18 Aug 2014 07:25:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.200.71 with HTTP; Mon, 18 Aug 2014 07:25:24 -0700 (PDT) In-Reply-To: <53F1E988.7090808@apache.org> References: <53F1E988.7090808@apache.org> From: Vikas Saurabh Date: Mon, 18 Aug 2014 19:55:24 +0530 Message-ID: Subject: Re: [Document Cache Size] Is it better to have cache size using number of entries To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org >> we can probably have both and cache respects whichever constraint hits >> first (sort of min(byte size, entry size)). > First of all I don't know MongoNS implementation details so I can be wrong. > > I'd rather keep the size in bytes as it gives me much more control over > the memory I have and what I decide to provide to the application. If we > say, to take an extreme example, 1 document only in cache and then this > single document exceed the amount of available memory I fear an OOM. On > the other hand having bytes ensure us the application keeps working and > it will be task of a sysadmin to monitor the eventual hit/miss ratio to > adjust the cache accordingly. > Yes, sysadmin can modify cache size in bytes if miss ratio increases. But, in current scenario, I couldn't figure out a neat way (heuristic/guesswork) to figure out if it's application mis-behavior or lack of cache size (notice our issue didn't happen to be related to cache size... but still the question did bug us). On the other hand, an sysadmin can be provided with a rough idea about relation of (frequently used) repo nodes using which sysadmin can update cache size. Also, I do take the point of avoiding OOMs in case of pretty large documents which is why we can have both properties(byte size and entry count) with byte constraint being a fail safe. Thanks, Vikas