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 38CD8D906 for ; Wed, 10 Oct 2012 17:35:32 +0000 (UTC) Received: (qmail 3762 invoked by uid 500); 10 Oct 2012 17:35:30 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 3725 invoked by uid 500); 10 Oct 2012 17:35:30 -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 3717 invoked by uid 99); 10 Oct 2012 17:35:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Oct 2012 17:35:30 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_PROFILE2 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pekka.korolainen@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-ia0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Oct 2012 17:35:26 +0000 Received: by mail-ia0-f180.google.com with SMTP id f6so557361iag.11 for ; Wed, 10 Oct 2012 10:35:06 -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=u4aGcLpDc1sQ3tGtGfWYIshUxAULHL6TnMufQKuhwtc=; b=mBBPT/TZMQdAHTyaPBP6lfMd+LzodR+JBh8Jvo3h/djtBfpyY7YvIYJjdLurXh9bWl 8CvvjlSJB/6FNNj0FeM1/Ag8AeF4n9wPXA84VwUpQm/xcxcXm8zYyCgYJlwguzkjNuVK IbY+JJwU/wfFKSw6MWFMz33KwqZnnN/d2AGVsslC1/0N67Lu3aBxYSFfG1k6UZj18MdJ THeM4zjNm+lP/mVqGj+So9NA0u6axoeXzqFu2Iw6E6Q4+7qyjPKlvuZJ7dAbZs9fLZJP IygwB3Pmcpmz2+XVPx/9jSIND90eiXuqTHPP1W0PdPfbA5LdSEclw3zvZauRqPDqLNbC l79w== MIME-Version: 1.0 Received: by 10.50.47.129 with SMTP id d1mr6221143ign.45.1349890506172; Wed, 10 Oct 2012 10:35:06 -0700 (PDT) Received: by 10.64.69.232 with HTTP; Wed, 10 Oct 2012 10:35:05 -0700 (PDT) In-Reply-To: <-338469174318493662@unknownmsgid> References: <5101775102082197267@unknownmsgid> <2044897088691076451@unknownmsgid> <-338469174318493662@unknownmsgid> Date: Wed, 10 Oct 2012 20:35:05 +0300 Message-ID: Subject: Re: CouchDB bleeding CPU From: Pekka Olavi To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Yeah, I wasn't thinking that either. But I'm hoping running a more state of the art erlang would be a good try to fix this :-) On Wed, Oct 10, 2012 at 5:25 PM, Robert Newson wrote: > Sorry, I meant that R15B02's scheduler could be the cause of this, not > a solution. Since you're not using it, it's obviously not that. > > If you're making no requests and /_active_tasks is empty and beam is > still chewing CPU, then that's a bit of a puzzle. > > Sent from the ocean floor > > On 10 Oct 2012, at 14:37, Pekka Olavi wrote: > >> Thanks Dave and Robert! >> >> Actually, from the ten threads spawned two are doing this, the other >> about 10x more than the other. As far as I understand, the engine >> should be doing nothing (it's almost empty, just on db with 2 design >> docs and 4 normal ones), so this scheduling thingy Robert mentioned >> seems like a good candidate to start with. I'm currently at R14B02, >> I'll upgrade and see what happens with a newer version. >> >> .p >> >> On Wed, Oct 10, 2012 at 4:24 PM, Robert Newson wrote: >>> http://dieswaytoofast.blogspot.com.es/2012/09/cpu-utilization-in-erlang-r15b02.html?m=1 >>> >>> Sent from the ocean floor >>> >>> On 10 Oct 2012, at 14:23, Robert Newson wrote: >>> >>> I recall R15B02, perhaps earlier, introduced a scheduler that kept the >>> CPU hot to eliminate delays when changing state from idle. I read that >>> somewhere recently, but can't find the link. >>> >>> Sent from the ocean floor >>> >>> On 10 Oct 2012, at 13:05, Dave Cottlehuber wrote: >>> >>> On 10 October 2012 13:50, Pekka Olavi wrote: >>> >>> Hello folks, I run a couch on my desktop for testing purposes. >>> >>> Everything else is fine and dandy and I'm actually loving developing >>> >>> for the web with couch. There is one gripe though, the beam.smp >>> >>> process is bleeding the CPU, for some reason I have no proficiency to >>> >>> analyse. >>> >>> >>> http://pastebin.com/eqtUyNZS >>> >>> >>> I start the server with "sudo couchdb" and it shows up in my ps aux like so: >>> >>> /usr/lib/erlang/erts-5.8.3/bin/beam.smp -Bd -K true -A 4 -- -root >>> >>> /usr/lib/erlang -progname erl -- -home /home/halides -- -noshell >>> >>> -noinput -os_mon start_memsup false start_cpu_sup false >>> >>> disk_space_check_interval 1 disk_almost_full_threshold 1 -sasl >>> >>> errlog_type error -couch_ini /usr/local/etc/couchdb/default.ini >>> >>> /usr/local/etc/couchdb/local.ini -s couch >>> >>> >>> Any help appreciated! >>> >>> >>> .p >>> >>> >>> Hi Pekka, >>> >>> >>> What is couchdb doing at the time? e.g. are you view indexing, >>> >>> whatever. Anything in the couch.log when running in debug mode? >>> >>> >>> None of this will fix the problem, but it might be helpful to note >>> >>> what OS you're running as well, and how erlang was compiledm (or >>> >>> rpmd). >>> >>> >>> Some of the flags you are using seem wrong if you are intending to >>> >>> enable kernel polling and increase the IO scheduler threads. >>> >>> >>> -A 4 should be +A 4 >>> >>> -K true should be +K true >>> >>> ditto for your +Bd option >>> >>> >>> You might be interested in some of the tricks in here >>> >>> http://erlang-in-production.herokuapp.com/#16 from archaelus, and let >>> >>> us know what processes are hogging. >>> >>> >>> After that, I think your best bet will be to hop on irc in #erlang or >>> >>> #erlounge and get some other smart ideas. >>> >>> >>> A+ >>> >>> Dave