You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Yuuki Takano <yt...@jaist.ac.jp> on 2008/10/20 15:07:24 UTC

couchDB gave up building views

Hi there,

I inserted 20,000 documents into couchDB, and looked up views of it.
However , couchDB gave up building views because of timed out.

The views were quite simple, such as

function(doc) {
    if (doc.type == 'vote') {
        emit([doc.service, doc.user, doc.item], doc);
    }
}

It seems that couchDB does not support many documents at this version (0.8.1).
Is that right?

Regards,

-- Yuuki Takano <yt...@jaist.ac.jp>

Re: couchDB gave up building views

Posted by Patrick Aljord <pa...@gmail.com>.
>    emit([doc.service, doc.user, doc.item], doc);
>

I think emitting the whole doc makes the map much slower but your doc is not
that big so I'm not sure whether it should get that much slower. Try with
null instead of doc. You can use include_docs=true I think (especially if
you don't always need to include all docs.).

Re: couchDB gave up building views

Posted by Yuuki Takano <yt...@jaist.ac.jp>.
of cource,

document:
{"_id":"0001be07fbf3cebd129acb6b2d57896a",
 "_rev":"2343492783",
 "date":1.22456723829709005356e+09,
 "type":"vote",
 "service":"ml1",
 "user":"627",
 "item":"1135",
 "rate":3,
 "_revs_info":[{"rev":"2343492783","status":"available"}]}

map func:
function(doc) {
  if (doc.type == 'vote')
    emit([doc.service, doc.user, doc.item], doc);
}


no reduce



2008/10/21 Chris Anderson <jc...@apache.org>:
> can you post an example document and map function? there's no reason
> they should be taking so long.
>
> On Tue, Oct 21, 2008 at 1:21 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>> So I read a source of couchDB, I understood why my map functions were
>> considered they have bugs.
>>
>> readline/2 function in couch_query_servers.erl reads and waits data
>> from Port connected to the couchjs,
>> and it give up waiting after 5 seconds.
>> This means couchDB cannot build views if couchjs cannot send data in 5 seconds.
>>
>> In my situation, my map functions failed despite it work well when
>> there is a few document because of the reason above.
>> So, I changed hardcoded timeout seconds 5000 to 50000 and reinstall couchDB.
>> Then, my map functions work well.
>>
>>
>> Thank you for your comments.
>>
>>
>> 2008/10/21 Yuuki Takano <yt...@jaist.ac.jp>:
>>> Thank you very much.
>>>
>>>> One, your HTTP request should block until the view returns. If the
>>>> HTTP request times out you can just try again, or notify your user, or
>>>> what ever is appropriate.
>>>
>>> OK.
>>> I underdtand, tank you!
>>> I'll try it later.
>>>
>>>
>>>> The error that you received about the timeout in couch means your map
>>>> functions have a bug that is preventing them from returning data to
>>>> couch. Aftering fixing that issue, things should work smoothly.
>>>
>>> My map functions work well when there is a few document.
>>>
>>>
>>>
>>>> I'm guessing you are on an old version of Erlang. Build erlang from the latest source at erlang.org
>>>
>>> Thank you, but I use the earliest version of Erlang (v5.6.4).
>>>
>>>
>>> 2008/10/20 Damien Katz <da...@apache.org>:
>>>> I'm guessing you are on an old version of Erlang. Build erlang from the
>>>> latest source at erlang.org
>>>>
>>>> -Damien
>>>>
>>>>
>>>> On Oct 20, 2008, at 9:07 AM, Yuuki Takano wrote:
>>>>
>>>>> Hi there,
>>>>>
>>>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>>>> However , couchDB gave up building views because of timed out.
>>>>>
>>>>> The views were quite simple, such as
>>>>>
>>>>> function(doc) {
>>>>>   if (doc.type == 'vote') {
>>>>>       emit([doc.service, doc.user, doc.item], doc);
>>>>>   }
>>>>> }
>>>>>
>>>>> It seems that couchDB does not support many documents at this version
>>>>> (0.8.1).
>>>>> Is that right?
>>>>>
>>>>> Regards,
>>>>>
>>>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>>>
>>>>
>>>
>>
>
>
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

Re: couchDB gave up building views

Posted by Chris Anderson <jc...@apache.org>.
can you post an example document and map function? there's no reason
they should be taking so long.

On Tue, Oct 21, 2008 at 1:21 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
> So I read a source of couchDB, I understood why my map functions were
> considered they have bugs.
>
> readline/2 function in couch_query_servers.erl reads and waits data
> from Port connected to the couchjs,
> and it give up waiting after 5 seconds.
> This means couchDB cannot build views if couchjs cannot send data in 5 seconds.
>
> In my situation, my map functions failed despite it work well when
> there is a few document because of the reason above.
> So, I changed hardcoded timeout seconds 5000 to 50000 and reinstall couchDB.
> Then, my map functions work well.
>
>
> Thank you for your comments.
>
>
> 2008/10/21 Yuuki Takano <yt...@jaist.ac.jp>:
>> Thank you very much.
>>
>>> One, your HTTP request should block until the view returns. If the
>>> HTTP request times out you can just try again, or notify your user, or
>>> what ever is appropriate.
>>
>> OK.
>> I underdtand, tank you!
>> I'll try it later.
>>
>>
>>> The error that you received about the timeout in couch means your map
>>> functions have a bug that is preventing them from returning data to
>>> couch. Aftering fixing that issue, things should work smoothly.
>>
>> My map functions work well when there is a few document.
>>
>>
>>
>>> I'm guessing you are on an old version of Erlang. Build erlang from the latest source at erlang.org
>>
>> Thank you, but I use the earliest version of Erlang (v5.6.4).
>>
>>
>> 2008/10/20 Damien Katz <da...@apache.org>:
>>> I'm guessing you are on an old version of Erlang. Build erlang from the
>>> latest source at erlang.org
>>>
>>> -Damien
>>>
>>>
>>> On Oct 20, 2008, at 9:07 AM, Yuuki Takano wrote:
>>>
>>>> Hi there,
>>>>
>>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>>> However , couchDB gave up building views because of timed out.
>>>>
>>>> The views were quite simple, such as
>>>>
>>>> function(doc) {
>>>>   if (doc.type == 'vote') {
>>>>       emit([doc.service, doc.user, doc.item], doc);
>>>>   }
>>>> }
>>>>
>>>> It seems that couchDB does not support many documents at this version
>>>> (0.8.1).
>>>> Is that right?
>>>>
>>>> Regards,
>>>>
>>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>>
>>>
>>
>



-- 
Chris Anderson
http://jchris.mfdz.com

Re: couchDB gave up building views

Posted by Yuuki Takano <yt...@jaist.ac.jp>.
So I read a source of couchDB, I understood why my map functions were
considered they have bugs.

readline/2 function in couch_query_servers.erl reads and waits data
from Port connected to the couchjs,
and it give up waiting after 5 seconds.
This means couchDB cannot build views if couchjs cannot send data in 5 seconds.

In my situation, my map functions failed despite it work well when
there is a few document because of the reason above.
So, I changed hardcoded timeout seconds 5000 to 50000 and reinstall couchDB.
Then, my map functions work well.


Thank you for your comments.


2008/10/21 Yuuki Takano <yt...@jaist.ac.jp>:
> Thank you very much.
>
>> One, your HTTP request should block until the view returns. If the
>> HTTP request times out you can just try again, or notify your user, or
>> what ever is appropriate.
>
> OK.
> I underdtand, tank you!
> I'll try it later.
>
>
>> The error that you received about the timeout in couch means your map
>> functions have a bug that is preventing them from returning data to
>> couch. Aftering fixing that issue, things should work smoothly.
>
> My map functions work well when there is a few document.
>
>
>
>> I'm guessing you are on an old version of Erlang. Build erlang from the latest source at erlang.org
>
> Thank you, but I use the earliest version of Erlang (v5.6.4).
>
>
> 2008/10/20 Damien Katz <da...@apache.org>:
>> I'm guessing you are on an old version of Erlang. Build erlang from the
>> latest source at erlang.org
>>
>> -Damien
>>
>>
>> On Oct 20, 2008, at 9:07 AM, Yuuki Takano wrote:
>>
>>> Hi there,
>>>
>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>> However , couchDB gave up building views because of timed out.
>>>
>>> The views were quite simple, such as
>>>
>>> function(doc) {
>>>   if (doc.type == 'vote') {
>>>       emit([doc.service, doc.user, doc.item], doc);
>>>   }
>>> }
>>>
>>> It seems that couchDB does not support many documents at this version
>>> (0.8.1).
>>> Is that right?
>>>
>>> Regards,
>>>
>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>
>>
>

Re: couchDB gave up building views

Posted by Yuuki Takano <yt...@jaist.ac.jp>.
Thank you very much.

> One, your HTTP request should block until the view returns. If the
> HTTP request times out you can just try again, or notify your user, or
> what ever is appropriate.

OK.
I underdtand, tank you!
I'll try it later.


> The error that you received about the timeout in couch means your map
> functions have a bug that is preventing them from returning data to
> couch. Aftering fixing that issue, things should work smoothly.

My map functions work well when there is a few document.



> I'm guessing you are on an old version of Erlang. Build erlang from the latest source at erlang.org

Thank you, but I use the earliest version of Erlang (v5.6.4).


2008/10/20 Damien Katz <da...@apache.org>:
> I'm guessing you are on an old version of Erlang. Build erlang from the
> latest source at erlang.org
>
> -Damien
>
>
> On Oct 20, 2008, at 9:07 AM, Yuuki Takano wrote:
>
>> Hi there,
>>
>> I inserted 20,000 documents into couchDB, and looked up views of it.
>> However , couchDB gave up building views because of timed out.
>>
>> The views were quite simple, such as
>>
>> function(doc) {
>>   if (doc.type == 'vote') {
>>       emit([doc.service, doc.user, doc.item], doc);
>>   }
>> }
>>
>> It seems that couchDB does not support many documents at this version
>> (0.8.1).
>> Is that right?
>>
>> Regards,
>>
>> -- Yuuki Takano <yt...@jaist.ac.jp>
>
>

Re: couchDB gave up building views

Posted by Damien Katz <da...@apache.org>.
I'm guessing you are on an old version of Erlang. Build erlang from  
the latest source at erlang.org

-Damien


On Oct 20, 2008, at 9:07 AM, Yuuki Takano wrote:

> Hi there,
>
> I inserted 20,000 documents into couchDB, and looked up views of it.
> However , couchDB gave up building views because of timed out.
>
> The views were quite simple, such as
>
> function(doc) {
>    if (doc.type == 'vote') {
>        emit([doc.service, doc.user, doc.item], doc);
>    }
> }
>
> It seems that couchDB does not support many documents at this  
> version (0.8.1).
> Is that right?
>
> Regards,
>
> -- Yuuki Takano <yt...@jaist.ac.jp>


Re: couchDB gave up building views

Posted by Paul Davis <pa...@gmail.com>.
On Mon, Oct 20, 2008 at 9:57 AM, Ayende Rahien <ay...@ayende.com> wrote:
> Is it possible to get a group of documents 20,000 long?
>

Assuming you mean, is it possible for 20,000 documents to be sent in
one chunk to a view server... Actually, as a matter of fact....
(checking code) it looks like a big no on that. couch_query_servers is
sending them across the wire one at a time. Though for a given design
doc, all map functions are executed on the doc in the same go.



> On Mon, Oct 20, 2008 at 3:51 PM, Paul Davis <pa...@gmail.com>wrote:
>
>> Yeah, that means your map function took too long to complete a map
>> operation. (5 seconds IIRC). If your map functions are taking that
>> long you should reexamine them. (That's per group of docs sent, not
>> the entire operation mind you)
>>
>> Paul
>>
>> On Mon, Oct 20, 2008 at 9:47 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>> > Thank you for your quick response.
>> >
>> > When I looking up views, the process "couchjs" is running and takes
>> > 90% of CPU resources.
>> > However, that process stop after receiving following response.
>> >
>> > {"error":"error","reason":"{{nocatch,{map_process_error,\"map function
>> > timed out\"}},
>> >  [{couch_query_servers,readline,2},
>> >  {couch_query_servers,read_json,1},
>> >  {couch_query_servers,prompt,2},
>> >  {couch_query_servers,'-rereduce\/3-fun-0-',3},
>> >  {lists,zipwith,3},\n  {couch_query_servers,rereduce,3},
>> >  {couch_view,'-init_group\/4-fun-0-',4},
>> >  {couch_btree,'-write_node\/3-lc$^0\/1-0-',3}]}"}
>> >
>> > So, I think couchDB gave up building views despite it had to continue.
>> >
>> >
>> > 2008/10/20 Paul Davis <pa...@gmail.com>:
>> >> Also, i think there's work on a patch to be able to query couch on the
>> >> status of view generation. If not, sorry to get your hopes up.
>> >>
>> >> Paul
>> >>
>> >> On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com>
>> wrote:
>> >>> What's probably timing out is your http request, not the view
>> >>> building. Views with a large number of docs can take a while to build
>> >>> initially, but the build process will continue even if your request
>> >>> times out. Typically I keep an eye on the cpu usage on the couchjs
>> >>> process(es) to see when it calms down – that usually means the build
>> >>> is done.
>> >>>
>> >>> --
>> >>> Ed Finkler
>> >>> http://funkatron.com
>> >>> AIM: funka7ron
>> >>> ICQ: 3922133
>> >>> Skype: funka7ron
>> >>>
>> >>>
>> >>> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp>
>> wrote:
>> >>>> Hi there,
>> >>>>
>> >>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>> >>>> However , couchDB gave up building views because of timed out.
>> >>>>
>> >>>> The views were quite simple, such as
>> >>>>
>> >>>> function(doc) {
>> >>>>    if (doc.type == 'vote') {
>> >>>>        emit([doc.service, doc.user, doc.item], doc);
>> >>>>    }
>> >>>> }
>> >>>>
>> >>>> It seems that couchDB does not support many documents at this version
>> (0.8.1).
>> >>>> Is that right?
>> >>>>
>> >>>> Regards,
>> >>>>
>> >>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>> >>>>
>> >>>
>> >>
>> >
>>
>

Re: couchDB gave up building views

Posted by Ayende Rahien <ay...@ayende.com>.
Is it possible to get a group of documents 20,000 long?

On Mon, Oct 20, 2008 at 3:51 PM, Paul Davis <pa...@gmail.com>wrote:

> Yeah, that means your map function took too long to complete a map
> operation. (5 seconds IIRC). If your map functions are taking that
> long you should reexamine them. (That's per group of docs sent, not
> the entire operation mind you)
>
> Paul
>
> On Mon, Oct 20, 2008 at 9:47 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
> > Thank you for your quick response.
> >
> > When I looking up views, the process "couchjs" is running and takes
> > 90% of CPU resources.
> > However, that process stop after receiving following response.
> >
> > {"error":"error","reason":"{{nocatch,{map_process_error,\"map function
> > timed out\"}},
> >  [{couch_query_servers,readline,2},
> >  {couch_query_servers,read_json,1},
> >  {couch_query_servers,prompt,2},
> >  {couch_query_servers,'-rereduce\/3-fun-0-',3},
> >  {lists,zipwith,3},\n  {couch_query_servers,rereduce,3},
> >  {couch_view,'-init_group\/4-fun-0-',4},
> >  {couch_btree,'-write_node\/3-lc$^0\/1-0-',3}]}"}
> >
> > So, I think couchDB gave up building views despite it had to continue.
> >
> >
> > 2008/10/20 Paul Davis <pa...@gmail.com>:
> >> Also, i think there's work on a patch to be able to query couch on the
> >> status of view generation. If not, sorry to get your hopes up.
> >>
> >> Paul
> >>
> >> On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com>
> wrote:
> >>> What's probably timing out is your http request, not the view
> >>> building. Views with a large number of docs can take a while to build
> >>> initially, but the build process will continue even if your request
> >>> times out. Typically I keep an eye on the cpu usage on the couchjs
> >>> process(es) to see when it calms down – that usually means the build
> >>> is done.
> >>>
> >>> --
> >>> Ed Finkler
> >>> http://funkatron.com
> >>> AIM: funka7ron
> >>> ICQ: 3922133
> >>> Skype: funka7ron
> >>>
> >>>
> >>> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp>
> wrote:
> >>>> Hi there,
> >>>>
> >>>> I inserted 20,000 documents into couchDB, and looked up views of it.
> >>>> However , couchDB gave up building views because of timed out.
> >>>>
> >>>> The views were quite simple, such as
> >>>>
> >>>> function(doc) {
> >>>>    if (doc.type == 'vote') {
> >>>>        emit([doc.service, doc.user, doc.item], doc);
> >>>>    }
> >>>> }
> >>>>
> >>>> It seems that couchDB does not support many documents at this version
> (0.8.1).
> >>>> Is that right?
> >>>>
> >>>> Regards,
> >>>>
> >>>> -- Yuuki Takano <yt...@jaist.ac.jp>
> >>>>
> >>>
> >>
> >
>

Re: couchDB gave up building views

Posted by Paul Davis <pa...@gmail.com>.
On Mon, Oct 20, 2008 at 10:31 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
> Thank you for your responses.
>
> I looked up views such as
> /_view/votes/votes?count=10&group=true
>
>> Yeah, that means your map function took too long to complete a map
>> operation. (5 seconds IIRC). If your map functions are taking that
>> long you should reexamine them. (That's per group of docs sent, not
>> the entire operation mind you)
>
> This means I have to look up "/_view/votes/votes?count=10&group=true"
> repeatedly until receiving valid responses.
> After repeating reasonable times, I can get responses I want.
> Is that right?
>

One, your HTTP request should block until the view returns. If the
HTTP request times out you can just try again, or notify your user, or
what ever is appropriate.

The first time you query the view, it will try start a process that
irregardless of subsequence requests, will build the entire view.

The error that you received about the timeout in couch means your map
functions have a bug that is preventing them from returning data to
couch. Aftering fixing that issue, things should work smoothly.

HTH,
Paul

>
>
> 2008/10/20 Paul Davis <pa...@gmail.com>:
>> Yeah, that means your map function took too long to complete a map
>> operation. (5 seconds IIRC). If your map functions are taking that
>> long you should reexamine them. (That's per group of docs sent, not
>> the entire operation mind you)
>>
>> Paul
>>
>> On Mon, Oct 20, 2008 at 9:47 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>>> Thank you for your quick response.
>>>
>>> When I looking up views, the process "couchjs" is running and takes
>>> 90% of CPU resources.
>>> However, that process stop after receiving following response.
>>>
>>> {"error":"error","reason":"{{nocatch,{map_process_error,\"map function
>>> timed out\"}},
>>>  [{couch_query_servers,readline,2},
>>>  {couch_query_servers,read_json,1},
>>>  {couch_query_servers,prompt,2},
>>>  {couch_query_servers,'-rereduce\/3-fun-0-',3},
>>>  {lists,zipwith,3},\n  {couch_query_servers,rereduce,3},
>>>  {couch_view,'-init_group\/4-fun-0-',4},
>>>  {couch_btree,'-write_node\/3-lc$^0\/1-0-',3}]}"}
>>>
>>> So, I think couchDB gave up building views despite it had to continue.
>>>
>>>
>>> 2008/10/20 Paul Davis <pa...@gmail.com>:
>>>> Also, i think there's work on a patch to be able to query couch on the
>>>> status of view generation. If not, sorry to get your hopes up.
>>>>
>>>> Paul
>>>>
>>>> On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com> wrote:
>>>>> What's probably timing out is your http request, not the view
>>>>> building. Views with a large number of docs can take a while to build
>>>>> initially, but the build process will continue even if your request
>>>>> times out. Typically I keep an eye on the cpu usage on the couchjs
>>>>> process(es) to see when it calms down – that usually means the build
>>>>> is done.
>>>>>
>>>>> --
>>>>> Ed Finkler
>>>>> http://funkatron.com
>>>>> AIM: funka7ron
>>>>> ICQ: 3922133
>>>>> Skype: funka7ron
>>>>>
>>>>>
>>>>> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>>>>>> Hi there,
>>>>>>
>>>>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>>>>> However , couchDB gave up building views because of timed out.
>>>>>>
>>>>>> The views were quite simple, such as
>>>>>>
>>>>>> function(doc) {
>>>>>>    if (doc.type == 'vote') {
>>>>>>        emit([doc.service, doc.user, doc.item], doc);
>>>>>>    }
>>>>>> }
>>>>>>
>>>>>> It seems that couchDB does not support many documents at this version (0.8.1).
>>>>>> Is that right?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>>>>>
>>>>>
>>>>
>>>
>>
>

Re: couchDB gave up building views

Posted by Yuuki Takano <yt...@jaist.ac.jp>.
Thank you for your responses.

I looked up views such as
/_view/votes/votes?count=10&group=true

> Yeah, that means your map function took too long to complete a map
> operation. (5 seconds IIRC). If your map functions are taking that
> long you should reexamine them. (That's per group of docs sent, not
> the entire operation mind you)

This means I have to look up "/_view/votes/votes?count=10&group=true"
repeatedly until receiving valid responses.
After repeating reasonable times, I can get responses I want.
Is that right?



2008/10/20 Paul Davis <pa...@gmail.com>:
> Yeah, that means your map function took too long to complete a map
> operation. (5 seconds IIRC). If your map functions are taking that
> long you should reexamine them. (That's per group of docs sent, not
> the entire operation mind you)
>
> Paul
>
> On Mon, Oct 20, 2008 at 9:47 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>> Thank you for your quick response.
>>
>> When I looking up views, the process "couchjs" is running and takes
>> 90% of CPU resources.
>> However, that process stop after receiving following response.
>>
>> {"error":"error","reason":"{{nocatch,{map_process_error,\"map function
>> timed out\"}},
>>  [{couch_query_servers,readline,2},
>>  {couch_query_servers,read_json,1},
>>  {couch_query_servers,prompt,2},
>>  {couch_query_servers,'-rereduce\/3-fun-0-',3},
>>  {lists,zipwith,3},\n  {couch_query_servers,rereduce,3},
>>  {couch_view,'-init_group\/4-fun-0-',4},
>>  {couch_btree,'-write_node\/3-lc$^0\/1-0-',3}]}"}
>>
>> So, I think couchDB gave up building views despite it had to continue.
>>
>>
>> 2008/10/20 Paul Davis <pa...@gmail.com>:
>>> Also, i think there's work on a patch to be able to query couch on the
>>> status of view generation. If not, sorry to get your hopes up.
>>>
>>> Paul
>>>
>>> On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com> wrote:
>>>> What's probably timing out is your http request, not the view
>>>> building. Views with a large number of docs can take a while to build
>>>> initially, but the build process will continue even if your request
>>>> times out. Typically I keep an eye on the cpu usage on the couchjs
>>>> process(es) to see when it calms down – that usually means the build
>>>> is done.
>>>>
>>>> --
>>>> Ed Finkler
>>>> http://funkatron.com
>>>> AIM: funka7ron
>>>> ICQ: 3922133
>>>> Skype: funka7ron
>>>>
>>>>
>>>> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>>>>> Hi there,
>>>>>
>>>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>>>> However , couchDB gave up building views because of timed out.
>>>>>
>>>>> The views were quite simple, such as
>>>>>
>>>>> function(doc) {
>>>>>    if (doc.type == 'vote') {
>>>>>        emit([doc.service, doc.user, doc.item], doc);
>>>>>    }
>>>>> }
>>>>>
>>>>> It seems that couchDB does not support many documents at this version (0.8.1).
>>>>> Is that right?
>>>>>
>>>>> Regards,
>>>>>
>>>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>>>>
>>>>
>>>
>>
>

Re: couchDB gave up building views

Posted by Paul Davis <pa...@gmail.com>.
Yeah, that means your map function took too long to complete a map
operation. (5 seconds IIRC). If your map functions are taking that
long you should reexamine them. (That's per group of docs sent, not
the entire operation mind you)

Paul

On Mon, Oct 20, 2008 at 9:47 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
> Thank you for your quick response.
>
> When I looking up views, the process "couchjs" is running and takes
> 90% of CPU resources.
> However, that process stop after receiving following response.
>
> {"error":"error","reason":"{{nocatch,{map_process_error,\"map function
> timed out\"}},
>  [{couch_query_servers,readline,2},
>  {couch_query_servers,read_json,1},
>  {couch_query_servers,prompt,2},
>  {couch_query_servers,'-rereduce\/3-fun-0-',3},
>  {lists,zipwith,3},\n  {couch_query_servers,rereduce,3},
>  {couch_view,'-init_group\/4-fun-0-',4},
>  {couch_btree,'-write_node\/3-lc$^0\/1-0-',3}]}"}
>
> So, I think couchDB gave up building views despite it had to continue.
>
>
> 2008/10/20 Paul Davis <pa...@gmail.com>:
>> Also, i think there's work on a patch to be able to query couch on the
>> status of view generation. If not, sorry to get your hopes up.
>>
>> Paul
>>
>> On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com> wrote:
>>> What's probably timing out is your http request, not the view
>>> building. Views with a large number of docs can take a while to build
>>> initially, but the build process will continue even if your request
>>> times out. Typically I keep an eye on the cpu usage on the couchjs
>>> process(es) to see when it calms down – that usually means the build
>>> is done.
>>>
>>> --
>>> Ed Finkler
>>> http://funkatron.com
>>> AIM: funka7ron
>>> ICQ: 3922133
>>> Skype: funka7ron
>>>
>>>
>>> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>>>> Hi there,
>>>>
>>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>>> However , couchDB gave up building views because of timed out.
>>>>
>>>> The views were quite simple, such as
>>>>
>>>> function(doc) {
>>>>    if (doc.type == 'vote') {
>>>>        emit([doc.service, doc.user, doc.item], doc);
>>>>    }
>>>> }
>>>>
>>>> It seems that couchDB does not support many documents at this version (0.8.1).
>>>> Is that right?
>>>>
>>>> Regards,
>>>>
>>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>>>
>>>
>>
>

Re: couchDB gave up building views

Posted by Yuuki Takano <yt...@jaist.ac.jp>.
Thank you for your quick response.

When I looking up views, the process "couchjs" is running and takes
90% of CPU resources.
However, that process stop after receiving following response.

{"error":"error","reason":"{{nocatch,{map_process_error,\"map function
timed out\"}},
 [{couch_query_servers,readline,2},
  {couch_query_servers,read_json,1},
  {couch_query_servers,prompt,2},
  {couch_query_servers,'-rereduce\/3-fun-0-',3},
  {lists,zipwith,3},\n  {couch_query_servers,rereduce,3},
  {couch_view,'-init_group\/4-fun-0-',4},
  {couch_btree,'-write_node\/3-lc$^0\/1-0-',3}]}"}

So, I think couchDB gave up building views despite it had to continue.


2008/10/20 Paul Davis <pa...@gmail.com>:
> Also, i think there's work on a patch to be able to query couch on the
> status of view generation. If not, sorry to get your hopes up.
>
> Paul
>
> On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com> wrote:
>> What's probably timing out is your http request, not the view
>> building. Views with a large number of docs can take a while to build
>> initially, but the build process will continue even if your request
>> times out. Typically I keep an eye on the cpu usage on the couchjs
>> process(es) to see when it calms down – that usually means the build
>> is done.
>>
>> --
>> Ed Finkler
>> http://funkatron.com
>> AIM: funka7ron
>> ICQ: 3922133
>> Skype: funka7ron
>>
>>
>> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>>> Hi there,
>>>
>>> I inserted 20,000 documents into couchDB, and looked up views of it.
>>> However , couchDB gave up building views because of timed out.
>>>
>>> The views were quite simple, such as
>>>
>>> function(doc) {
>>>    if (doc.type == 'vote') {
>>>        emit([doc.service, doc.user, doc.item], doc);
>>>    }
>>> }
>>>
>>> It seems that couchDB does not support many documents at this version (0.8.1).
>>> Is that right?
>>>
>>> Regards,
>>>
>>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>>
>>
>

Re: couchDB gave up building views

Posted by Paul Davis <pa...@gmail.com>.
Also, i think there's work on a patch to be able to query couch on the
status of view generation. If not, sorry to get your hopes up.

Paul

On Mon, Oct 20, 2008 at 9:17 AM, Ed Finkler <fu...@gmail.com> wrote:
> What's probably timing out is your http request, not the view
> building. Views with a large number of docs can take a while to build
> initially, but the build process will continue even if your request
> times out. Typically I keep an eye on the cpu usage on the couchjs
> process(es) to see when it calms down – that usually means the build
> is done.
>
> --
> Ed Finkler
> http://funkatron.com
> AIM: funka7ron
> ICQ: 3922133
> Skype: funka7ron
>
>
> On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
>> Hi there,
>>
>> I inserted 20,000 documents into couchDB, and looked up views of it.
>> However , couchDB gave up building views because of timed out.
>>
>> The views were quite simple, such as
>>
>> function(doc) {
>>    if (doc.type == 'vote') {
>>        emit([doc.service, doc.user, doc.item], doc);
>>    }
>> }
>>
>> It seems that couchDB does not support many documents at this version (0.8.1).
>> Is that right?
>>
>> Regards,
>>
>> -- Yuuki Takano <yt...@jaist.ac.jp>
>>
>

Re: couchDB gave up building views

Posted by Ed Finkler <fu...@gmail.com>.
What's probably timing out is your http request, not the view
building. Views with a large number of docs can take a while to build
initially, but the build process will continue even if your request
times out. Typically I keep an eye on the cpu usage on the couchjs
process(es) to see when it calms down – that usually means the build
is done.

--
Ed Finkler
http://funkatron.com
AIM: funka7ron
ICQ: 3922133
Skype: funka7ron


On Mon, Oct 20, 2008 at 9:07 AM, Yuuki Takano <yt...@jaist.ac.jp> wrote:
> Hi there,
>
> I inserted 20,000 documents into couchDB, and looked up views of it.
> However , couchDB gave up building views because of timed out.
>
> The views were quite simple, such as
>
> function(doc) {
>    if (doc.type == 'vote') {
>        emit([doc.service, doc.user, doc.item], doc);
>    }
> }
>
> It seems that couchDB does not support many documents at this version (0.8.1).
> Is that right?
>
> Regards,
>
> -- Yuuki Takano <yt...@jaist.ac.jp>
>