couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCaffrey" <>
Subject Erlang View performance
Date Wed, 10 Mar 2010 00:03:34 GMT
Put some more timings in there to try and figure where the performance
problem is.

Couch is doing something periodically that takes about 15 milliseconds.

It's happening at all different spots in the fold function but
periodically at the very beginning where I have this code. These are the
first lines of code in the function.

                io:fwrite(\"~nWalk ~p\", [now()]),
                io:fwrite(\"~nGetRec1 ~p\", [now()]),

There will be a 15 millisecond delay between the two. 

What the heck is couch doing to cause this delay? 

Saw something about delay_commits in ini but it is set to true.

There is nothing else running against the db, all in dev.


-----Original Message-----
From: Randall Leeds [] 
Sent: Tuesday, March 09, 2010 1:06 PM
Subject: Re: Erlag View performance

If there's discussion to be had here, it should maybe go over to dev@,
so I'm crossposting there.

I looked at the code (only briefly), but you can take a look too...


It looks like the functions are (as per the view server api) parsed
only once and then just applied to the documents.
Now, the foldrows function is not just a call to lists:foldl, so maybe
there's a little extra overhead here.
Also, there might be more i/o contention when the results are being
written to the view index rather than just output in your eclipse
console (or maybe I don't understand your benchmark exactly).

If you are writing erlang views you must know some erlang, so maybe
take a look and see if you can't optimize the view server a bit.



On Tue, Mar 9, 2010 at 08:46, Michael McCaffrey <>
> Reposting, to try and get some traction on this. Baffled as to why the
> view takes 10-20 times longer per record in couch than running in pure
> erlang environment.
> When each record takes almost a second, things run forever...
> Any help appreciated.
> Hello,
> I'm using an erlang view to fold thru large deep lists and have a
> performance issue.
> Being a relative erlang newbie I thought it was a codingsue,
> When I run thru a document locally (in Eclipse) I can fold thru the
> in 47000 micro seconds.
> When I fold thru the same document during the view, it takes almost a
> full second (900000 micro seconds). All the documents take about this
> long.
> Any thoughts on why this may be happening?
> Thanks

View raw message