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 6A956921C for ; Tue, 12 Mar 2013 17:36:57 +0000 (UTC) Received: (qmail 36313 invoked by uid 500); 12 Mar 2013 17:27:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 14490 invoked by uid 500); 12 Mar 2013 17:26:29 -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 42420 invoked by uid 99); 12 Mar 2013 14:23:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 14:23:15 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.136.216.236] (HELO nm37-vm1.bullet.mail.gq1.yahoo.com) (98.136.216.236) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 14:23:09 +0000 Received: from [98.137.12.188] by nm37.bullet.mail.gq1.yahoo.com with NNFMP; 12 Mar 2013 14:22:49 -0000 Received: from [208.71.42.196] by tm9.bullet.mail.gq1.yahoo.com with NNFMP; 12 Mar 2013 14:22:49 -0000 Received: from [127.0.0.1] by smtp207.mail.gq1.yahoo.com with NNFMP; 12 Mar 2013 14:22:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1363098169; bh=wdYEA1U7ra6nB8VLoEDIIhs2/fg9kJDdZkeG/vRdkwo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:Content-Type:Message-Id:Mime-Version:Subject:Date:References:To:In-Reply-To:X-Mailer; b=hYhiXzDFWED4Aq4O/nw/wPUx1ve2bfSia0soUaGtpQbEwqlhriJoWYzovSiS6loSxfzc+JuJvQlyLRYu2g7Wji9lYjWqFrXxdnibaeSIW5IOEoF7EANME84nVe94mMVToob9x+rz8Ee1zrXwgbaEVXnzz3VwIWS5v2UFI+7vKdU= X-Yahoo-Newman-Id: 56132.39800.bm@smtp207.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: t1Ynre0VM1meOlvPf1ikaXta9yvVgZKYFFxVW0OQwsxIHEX RPCa4mCb9bMY12gs8ArMsmH4oLkEmRpK48z5RtAVgBY3JekeeP1_R4s63Svw Pxyjt5g5me.sBd9cyWSzF7oKLeo1L1.MSIplDwS5euRc2tp3BLd23w.V7ibO XHZeUE661zRkjt4ohKcRHFxrSkdSCJVlwXy2.xzeoFpze_cNCO9F_pALgrDc rx4yg50FHdwKmkTaWjCanmm9xlg.Oqo5jYg69UFF2UL21CF03nlNttusChC2 SmH3w1WpDLh9C.P563xgVfE_kqFH3HP0AvRSzBJMwm859yY0XQNl1tkPjRbl 6E46qttW1nR1hcAtPIeWhSO8Vuhe_MxPwJGtUsIYNpmjWjanSvKjU28OPObF IgnoO51CUrYwpK_YM07nskx.BXneUCgLvsWBt8fuXMwCdtiKHWRaKz_EdFml lYxtGaY4d.QqvfJyyCSl4vrGUN0_w297VqLbUdOYTXHEmuUcAUGucL5ZJRTN nCQM72q4p.h4loIhldWI- X-Yahoo-SMTP: b9FO.o6swBDjz1Oj2MrhmZVB01c- Received: from [10.1.10.15] (iomatix@71.197.38.211 with plain) by smtp207.mail.gq1.yahoo.com with SMTP; 12 Mar 2013 07:22:48 -0700 PDT From: Jeff Charette Content-Type: multipart/alternative; boundary="Apple-Mail=_8455EB7E-16F9-4DAB-947C-D0FF2852FCD2" Message-Id: <52CD3AC6-F1A7-495A-936B-5F2E85AA0620@yahoo.com> Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Very slow queries to view in design doc Date: Tue, 12 Mar 2013 10:22:49 -0400 References: <265B0514-CB04-4C5A-8824-77B3008F4D47@poplatek.fi> <60C7D1C6-DE78-4798-9E8F-AB03E2F25C7D@poplatek.fi> <5BB0B367-A723-4DC1-8C55-29E14CCC990A@poplatek.fi> To: user@couchdb.apache.org In-Reply-To: <5BB0B367-A723-4DC1-8C55-29E14CCC990A@poplatek.fi> X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_8455EB7E-16F9-4DAB-947C-D0FF2852FCD2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Is there a timeout message? Jeff Charette | Principal=20 We Are Charette web / identity / packaging m 415.298.2707 w wearecharette.com e jeffrey@wearecharette.com On Mar 12, 2013, at 5:50 AM, Sami Sierla = wrote: > Hi, >=20 > Issue happened again today. I was able to check file descriptors and = established tcp connections to CouchDB. file descriptors in use were = about 80 so they are not hitting any limits. Number of connections to = couch before and after reboot were about 130. >=20 > Reduce function counts sums from document attributes - there are about = one million documents in view. >=20 > Here's the raw json of map / reduce function: >=20 > "Summary": { > "map": "function(doc) { if (doc.objectType =3D=3D \"Document\" = && (doc.severity !=3D=3D 4)) { emit(doc.alertTime, {\"feeds\": = doc.feeds, \"severity\": doc.severity}); } }", > "reduce": "function(keys, values, rereduce) {\n var i, j, k, = v, res, feeds;\n res =3D {};\n if (!rereduce) {\n res[\"*,*\"] =3D = values.length;\n for (i =3D 0; i < values.length; i++) {\n k =3D = \"*,\"+values[i].severity;\n res[k] =3D (res[k] || 0) + 1;\n = feeds =3D values[i].feeds;\n for (j =3D 0; j < feeds.length; j++) = {\n k =3D feeds[j]+\",*\";\n res[k] =3D (res[k] || 0) + = 1;\n k =3D feeds[j]+\",\"+values[i].severity;\n res[k] =3D = (res[k] || 0) + 1;\n }\n }\n } else {\n for (i =3D 0; i < = values.length; i++) {\n v =3D values[i];\n for (k in v) = {\n res[k] =3D (res[k] || 0) + v[k];\n }\n }\n }\n = return res;\n}\n" > } >=20 > View entries are like this: > = {"id":"ac:431590","key":"2010-11-01T00:30:02.000+0000","value":{"feeds":["= BNK"],"severity":2}} >=20 > Again, this works just fine after reboot (even with reduce) but seems = to slow over time (about 24-48 hours) until it starts to timeout. >=20 > -Sami >=20 > On Mar 11, 2013, at 11:20 PM, Robert Newson = wrote: >=20 >> Can you access /_log on the server? might have information. >>=20 >> Does the custom reduce function actually reduce (that is, return a >> much smaller value than the input 'values' array)? >>=20 >> B. >>=20 >> On 11 March 2013 03:27, Sami Sierla wrote: >>> Hi, >>>=20 >>> There is custom reduce function in this view but result is same even = if reduce=3Dfalse. Could this have something to do with running out of = file descriptors (I unfortunately don't have sufficient user rights to = check this on server). Issue began after we added two databases = (unrelated to this view) to CouchDB (both have continuous replication to = standby server). >>>=20 >>> Best, >>> Sami >>>=20 >>> On Mar 8, 2013, at 4:20 PM, Robert Newson = wrote: >>>=20 >>>> Do you have a custom reduce function? Are the keys/values in that = view >>>> very large? >>>>=20 >>>> On 8 March 2013 08:18, Sami Sierla wrote: >>>>> Hi, >>>>>=20 >>>>> We are having odd issue with CouchDB 1.2.0 view queries - queries = to one particular view are very slow (tens of seconds with limit=3D1) = but queries to other views in the same design doc perform as they = should. Issue goes away if we restart CouchDB but comes back after few = hours. Views are periodically refreshed so there are no indexing = blocking the query. The setup we have consists of about ten CouchDB = databases on active db server (RHEL 5) and second standby server with = continuous CouchDB pull replication. Same view query works fine on the = standby server that has no other processes running. >>>>>=20 >>>>> Any ideas what could cause this? >>>>>=20 >>>>> Best, >>>>> Sami Sierla >>>=20 >=20 --Apple-Mail=_8455EB7E-16F9-4DAB-947C-D0FF2852FCD2--