Is it possible to boost up views/indexes creation in couchdb by multiple cores?
We have just converted a database of app run-time logs from MySQL to CouchDB. There are around 3M docs converted, occupy around 7GB.
Then we scripted out our first view (with reduce function) and did a query to invoke the first run of that view, make out a view creation/generation. It should take some time and I just did a 'top' on that machine to see process/cpu load stuff. I just noticed that there are 2 heavy process:
beam.smp
couchjs
It's interesting that they seems to occupy one core开发者_Python百科, even there are 4 cores on that machine. Is it possible to make couchdb make use of multiple cores while creating/updating views?
Currently this is not supported. My guess is that good multicore support will add complexity to CouchDB.
So far, CouchDB always chooses simplicity instead of features. (Did you know that CouchDB is only 18,000 lines of code? Compare with 1 million in MySQL or 100,000 in SQLite.)
When a design document view index is building, it uses one couchjs
process. If you have multiple design documents, then those will run in parallel. CouchDB will spawn one couchjs
process per design document, and the OS will spread them across multiple cores.
However, if you really need performance, BigCouch is Apache CouchDB-compatible and does support parallelized view index building using an oversharded architecture.
精彩评论