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 08CD9D807 for ; Thu, 7 Mar 2013 08:51:03 +0000 (UTC) Received: (qmail 61756 invoked by uid 500); 7 Mar 2013 08:51:01 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 61328 invoked by uid 500); 7 Mar 2013 08:51:01 -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 61299 invoked by uid 99); 7 Mar 2013 08:51:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 08:51:00 +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 nicolists@gmail.com designates 209.85.215.41 as permitted sender) Received: from [209.85.215.41] (HELO mail-la0-f41.google.com) (209.85.215.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 08:50:53 +0000 Received: by mail-la0-f41.google.com with SMTP id fo12so198877lab.14 for ; Thu, 07 Mar 2013 00:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=T1vxIEQmmyUsxGIB2MA64iMs2RlGw2GODfbbPj10j8k=; b=MitqiTzowIH3serPU2yPWX45DNmPw2JTZwhFN9W+TE/Va951URVmrshM9adWeeKG3Z VKCqCCzeU3eYzccZtVyrKMS+DpCnmu+VcpeL5/S/PDtySyTlc4Ro45KpMyY+tLWkhl/4 oN1/R6Up51Bu6h5fl9bfm/oRN+0MgAlQS2cw+C4YMqrBuAytlsmYySQVetUXksNBrGMI iRKAxTE/fVKHKiqV5KH9BogX9/UANyo52qe/6oCUUgxx5zeG/7VZYBWGozuR1l7xiRas F4obgPXVthqK9PrOs8Gho8i+7YezjKVf58t5AwWuhzJRXYqlOh9Q/oMsr9M0B7ND5Kc6 vaiA== MIME-Version: 1.0 X-Received: by 10.152.104.36 with SMTP id gb4mr28019024lab.13.1362646232289; Thu, 07 Mar 2013 00:50:32 -0800 (PST) Received: by 10.114.95.1 with HTTP; Thu, 7 Mar 2013 00:50:32 -0800 (PST) In-Reply-To: References: Date: Thu, 7 Mar 2013 09:50:32 +0100 Message-ID: Subject: Re: CouchDB compaction not catching up. From: Nicolas Peeters To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d04083d15a1598104d751cccf X-Virus-Checked: Checked by ClamAV on apache.org --f46d04083d15a1598104d751cccf Content-Type: text/plain; charset=ISO-8859-1 So the use case is some kind of transactional log associated with some kind of long running process (1 day). For each process, a few 100 thousands lines of "logging" are inserted. When the process has completed (user approval), we would like to delete all the associated "logs". Marking items as deleted is not really the issue. Recovering the space is. The data should ideally be available for up to a week or so. On Thu, Mar 7, 2013 at 9:24 AM, Riyad Kalla wrote: > Nicolas, > Can you provide some insight into how you decide which large batches of > records to delete and roughly how big (MB/GB wise) those batches are? What > is the required longevity of this tx information in this couch store? Is > this just temporary storage or is this the system of record and what you > are deleting in large batches are just temporary intermediary data? > > Understanding how you are using the data and turning over the data could > help assess some alternative strategies. > > Best, > Riyad > > On Thu, Mar 7, 2013 at 12:19 AM, Nicolas Peeters >wrote: > > > Hi CouchDB Users, > > > > *Disclaimer: I'm very aware that the use case is definitely not the best > > for CouchDB, but for now, we have to deal with it.* > > > > *Scenario:* > > > > We have a fairly large (~750Gb) CouchDB (1.2.0) database that is being > > used for transactional logs (very write heavy) (bad idea/design, I know, > > but that's besides the point of this question - we're looking at > > alternative designs). Once in a while, we delete some of the records in > > large batches and we have scheduled auto compaction, checking every 2 > > hours. > > > > This is the compaction config: > > > > [image: Inline image 1] > > > > From what I can see, the DB is being hammered significantly every 12 > hours > > and the compaction is taking (sometimes 24 hours (with a size of 100GB of > > log data, sometimes much more (up to 500GB)). > > > > We run on EC2. Large instances with EBS. No striping (yet), no IOPS. We > > tried fatter machines, but the improvement was really minimal. > > > > ** > > > > *The problem:* > > > > The problem is that compaction takes a very long time (e.g. 12h+) and > > reduces the performance of the entire stack. The main issue seems to be > > that it's hard for the compaction process to "keep up" with the > insertions, > > hence why it takes so long. Also, the compaction of the view takes long > > time (sometimes the view is 100GB). During the re-compaction of the view, > > clients don't get a response, which is blocking the processes. > > > > [image: Inline image 2] > > > > The view compaction takes approx. 8 hours and the indexing for the view > > are therefore slower and during the time that view indexes, another 300k > > insertions have been done (and it doesn't catch up). The only way to > solve > > the problem was to throttle the number of inserts from the app itself and > > then eventually the view compaction resolved. If we would have continued > to > > insert at the same rate, it would not have finished (and ultimately, we > > would have run out of disk space). > > > > Any recommendations to set it up on EC2 is welcome. Also configuration > > settings for the compaction would be helpful. > > > > Thanks. > > > > Nicolas > > > > PS: We are happily using CouchDB for other (more traditional) use case > > where it does go very well. > > > --f46d04083d15a1598104d751cccf--