Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-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 E5CBA9CD6 for ; Thu, 14 Jun 2012 13:06:07 +0000 (UTC) Received: (qmail 9996 invoked by uid 500); 14 Jun 2012 13:06:06 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 9963 invoked by uid 500); 14 Jun 2012 13:06:06 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 9955 invoked by uid 99); 14 Jun 2012 13:06:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 13:06:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nicolists@gmail.com designates 209.85.213.52 as permitted sender) Received: from [209.85.213.52] (HELO mail-yw0-f52.google.com) (209.85.213.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 13:05:59 +0000 Received: by yhpp61 with SMTP id p61so1540432yhp.11 for ; Thu, 14 Jun 2012 06:05:39 -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 :content-type; bh=3db4bQ5lLEHJLD/8G4wH0DoiLIOT8d3XnHRn1MSdIwA=; b=Amn/xPHlm0J5aNAx4kcVZBy7eEUjxcF/ygIFfcFuvoVHMzV+vwrC55ddFSQioE72wV AwMkWZKc1YOFzTC/KKfqbSdxj9oorFWGERkJ9zxhLj2v2qLT1qU5m0obKaXf0igTg7c1 JZdVEuoFTeFy+NYLxUk0A5dmjCQD59qFRZHii62Fe79gVco7/0Nqd0xzThnnUBTUNU5a 5+T/roRR4sXApR26Rsvbtev0+EUGoU7wOAunXh4rVXhj9cWBkDIoalI+evFEWzaJEEEi FMX6P1EMuNMIK4yiPS5sAsfH4B68QaCd15MFvmTi2xHTqOrIcFJ2VsUdcc6Ar156fnJ8 MveQ== MIME-Version: 1.0 Received: by 10.236.78.2 with SMTP id f2mr2413691yhe.118.1339679139074; Thu, 14 Jun 2012 06:05:39 -0700 (PDT) Received: by 10.146.156.11 with HTTP; Thu, 14 Jun 2012 06:05:39 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 Jun 2012 15:05:39 +0200 Message-ID: Subject: Re: Compaction Best Practices From: Nicolas Peeters To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf300514f432941804c26e5b20 X-Virus-Checked: Checked by ClamAV on apache.org --20cf300514f432941804c26e5b20 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Interesting suggestion. However, this would perhaps have the same effect (deleting/compacting the old DB is what makes the system slower)...? On Thu, Jun 14, 2012 at 2:54 PM, Robert Newson wrote: > Do you eventually delete every document you add? > > If so, consider using a rolling database scheme instead. At some > point, perhaps daily, start a new database and write new transaction > logs there. Continue deleting old logs from the previous database(s) > until they're empty (doc_count:0) and then delete the database. > > B. > > On 14 June 2012 13:44, Nicolas Peeters wrote: > > I'd like some advice from the community regarding compaction. > > > > *Scenario:* > > > > We have a large-ish CouchDB database that is being used for transaction= al > > logs (very write heavy). Once in a while, we delete some of the records > in > > large batches and we have scheduled compaction (not automatic (yet)) > every > > 12hours. > > > > From what I can see, the DB is being hammered significantly every 12 > hours > > and the compaction is taking 4 hours (with a size of 50-100GB of log > data). > > > > *The problem:* > > > > The problem is that compaction takes a very long time and reduces the > > performance of the stack. It seems that it's hard for the compaction > > process to "keep up" with the insertions, hence why it takes so long. > Also, > > what I'm not sure is how "incremental" the compaction is... > > > > 1. In this case, would it make sense to run the compaction more often > > (every 10 minutes); since we're write-heavy. > > 1. Should we just run more often? (so hopefully it doesn't do > > unnecessary work too often). Actually, in our case, we should > probably > > never have automatic compaction if there has been no "termination"= . > > 2. Or actually only once in a while? (bigger batch, but less > > "useless" overhead) > > 3. Or should we just wait that a given size (which is the problem > > really) is hit and use the auto compaction (in CouchDB 1.2.0) for > this? > > 2. In CouchDB 1.2.0 there's a new feature: auto > > compaction< > http://wiki.apache.org/couchdb/Compaction#Automatic_Compaction> > > which > > may be useful for us. There's the "strict_window" feature to give a m= ax > > amount of time to compact and cancel the compaction after that (in > order > > not to have it running for 4h+=85). I'm wondering what the impact of > that is > > on the long run. What if the compaction cannot be completed in that > window? > > > > Thanks a lot! > > > > Nicolas > --20cf300514f432941804c26e5b20--