Performance view queries
We use many direct key set/get operations as well as range queries on views.
However couchDB queries are much slower that memcached queries (we have measured a factor 10 at least in performance). The problem arises that if an app needs both, than couchDB views are eventually determining the speed of the app. Is there a way to have materialized views (e.g. as kv keys) to speed that up?
Where is the bottleneck?
Is that http? or is that related with the way couchDB index data? Are views queried on memory or on disk?
Hi there,
Which build of 2.0 are you currently using? If you are on DP4, I would recommend using a "Recent build", now also available on our download page (http://www.couchbase.com/download) Build 1495 is pretty new. 1554 has some behavior changes.
This particular build includes specific improvements around initial index building. You should see a significant improvement for this scenario. In addition, several performance improvements have been made to improve query latency.
Another aspect that you may want to think about is file system cache available for the index. Depending on the size of your indexes you may want to size for additional RAM. The OS will take care of keeping the working set of the actively accessed index pages in RAM. We have seen query latency half by doubling the OS cache available for the index beyond the bucket quota. Throughput also significantly improved.
Hope this helps
First off, the amount of work that goes into returning a query is much high than the amount of work required to get a single value. We also cache recently used values in memory in order to speed up basic operations. Indexes are also stored on disk which makes them slower, but in the future we will allow you to keep important indexes in memory.
>> Where is the bottleneck?
Views are on disk, http is slower than the memcached binary protocol, and putting together a view result takes much longer than getting a single value. We have plans to optimize queries to make them faster, but keep in mind they will never be the same speed as a basic get operation.