Hi,

The only thing that CouchDB 'caches' is the open file handles and misc
Erlang PID's that need to be spawned to interact with a given view.
Depending on what state the server was in before your first request
that may have had a noticeable impact.

The second aspect is getting the FS caches hot in the kernel. I'm not
overly familiar with the kernel's caching algorithms but they do make
a difference in performance according to the different test number's
I've seen. Most likely this is the tail that you're seeing.

HTH,
Paul Davis

On Mon, Oct 26, 2009 at 10:20 AM,  <[email protected]> wrote:
> Hi!
>
> I am using CouchDB 0.10 with jcouchdb 0.10.0-2 in a Java project. In my 
> CouchDB database are ~300.000 documents. I create a view which includes all 
> documents of the db and 3 key fields.
>
> I query this view and my result set has ~4400 documents. The view was already 
> built and needed about 7 minutes. I measured the time for the same query 
> multiple times and get the following performance (ms):
>
> 1586
> 864
> 601
> 242
> 231
> 319
> 244
> 253
> 302
> 338
> 268
> 246
> 240
> 275
> 253
> 274
> 250
> ...
>
> I need to know what leads to that performance result? I think for the first 
> query the B+-tree nodes (including root) has to be cached. 1585 ms for that 
> operation is pretty slow! But why does the second and third query need about 
> (600-800) ms? After the third query the time is about 250-300 ms. Does 
> CouchDB has some optimizations? So couchdb realizes I perform the same query 
> multiple times and after the third time it keeps the result set in the cache?
>
> Hope you can help me! Thx a lot.
>

Reply via email to