couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <>
Subject Re: Why are reads from CouchDB so slow? (1.5MB/s or thereabouts)
Date Fri, 23 Mar 2012 13:19:09 GMT
On Fri, Mar 23, 2012 at 04:41, Jonathan Williamson <> wrote:
> As I'm requesting the documents in the exact format I submitted them
> (with no transformations or extra information) I'd expect something
> not far off a static file request from Nginx. As far as I can tell the
> .couch files aren't compressed (though that wouldn't cause such slow
> performance on an i5 anyway) and appear to contain the original
> documents almost "as is".
> The other side effect is that while fetching the documents the CPU
> usages rises to 100% which suggests, I guess, that CouchDB is reading,
> deserialising, serialising, and then streaming the document. But it
> doesn't seem like that should be necessary really?

Couch ensures that your doc is valid JSON and indeed reserializes the
JSON for every read. The reason is that we've opted out of the
byte-level twiddling that would be required to insert metadata inside
the document body when certain query parameters are passed that would
allow us to keep the bulk of the doc pre-serialized.

The 100% cpu overhead is likely the JSON serialization. The 1.2.x
branch uses a brand new serializer, written in C. It would be
interesting if you could try it.

View raw message