couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Re: View Performance (was Re: The 1.0 Thread)
Date Thu, 02 Jul 2009 15:56:51 GMT
On Thu, Jul 02, 2009 at 02:20:47PM +0100, Brian Candler wrote:
>   5 K/V pairs per doc...                                         7.693 secs

(that's with 3000 docs)

In order to see how much of this time is down to Javascript, I wrote a null
view server in Ruby which just returns 5 random key/values in response to
any map_doc request without any other processing.

  [query_servers]
  bork = /usr/bin/ruby /home/brian/bork.rb

With this, that benchmark is down to 2.856 secs, although of course the
actual view data is rubbish :-) This suggests a rough limit achievable by
external view server optimisation alone (e.g. writing your views in 'C') of
over 5000 K/V inserts per second, which would be impressive on this old
laptop.

If I modify bork.rb not to emit any keys at all, the view build takes 0.977
secs, which is the time to send the documents out as JSON and receive empty
replies. So that means the remaining 1.9 secs is the time to receive these
15000 K/V pairs and insert them into the Btree, or about 8000 inserts/sec.
I'd say that's already pretty zippy, so the best bang-for-buck in improving
view performance will be achieved by speeding up the view server itself, and
the communication to the view server. Time to look at COUCHDB-377.

I don't have a multi-CPU machine to test this, but another simple
optimisation would be to add pipelining of map_doc calls so that two CPUs
can be spinning at once.

Regards,

Brian.

Mime
View raw message