Erlang is used internally to manage and monitor all the persistence. So Couchbase Server is monitoring data files in order to see whether data fles are compacted and compact files when necessary; same with the view/indexes.
So this explains some CPU cycles of the erlang engine.
Remember that if you have installed the samples buckets (beer-sample, game-sample) contain some views.
My laptop is a retina macbook with an ivy bridge quad core in it. There is only 1 data bucket, with no documents in it and no indexes and views. I disabled everything that does anything with couchbase.
Still erl.exe takes up 5 - 10% of the CPU (after a fresh reboot of my laptop) and takes a whopping 334 MB for what? Also memcached.exe takes up 162 mb. That is around 500MB without any documents.
I’m sorry, I have no experience with couchbase but I can’t believe this is normal?
Couchbase is a great product, got it up and running and working nicely. I also tried out the balancing/replication thing and this works like a charm.
The only thing that sets me back is the idle cpu usage. Even when I restart my laptop (on which I got it running), as soon as the couchbase service starts running I can see erl.exe taking up 10% - 30% of my cpu with intervals (some seconds 0% some seconds between 15 and 30%)
I have no buckets but the default installed, no indexes/views, just a clean install.
Alright, I deleted the bucket and created a memcached one. Now the memory and cpu of erl.exe and memcached.exe are more of what i’d expect (low).
Still would like to know how a few couchbase buckets will be doing on an production environment.
Like I said, I’m new to couchbase so most likely I’m wrong but if 3 of my servers (which aren’t that new) are busy compacting all the time this would be a huge hit on my server resources.
I can confirm this. On a clean installation with one empty couchbase bucket, after idling for 7 days, the erl.exe process has accumulated more than 50 hours of CPU time, which is equivalent to 30% of one CPU. For comparison, my own python.exe process has accumulated 10 seconds of CPU time.
CPU is wasted on a very inefficient process of persisting metrics into compressed files on the file system at different time scales. Does anybody know how to decrease this interval at least?
In our newest 7.X releases the CPU usage in what is considered an idle system is much lower. Although he processing overhead is still not zero the recurring CPU used for coordination between processes and monitoring is greatly reduced. In past release the CPU overhead was associated with the number of buckets, however the introduction of collections allows the equivalent of a 1,000 lightweight buckets (in a bucket.scope.collection organization) refer to What’s New in Version 7.6 | Couchbase Docs.
To give some concrete information on the improvements for a tiny three node cluster (3x AWS t3.small which is not even recommended for couchbase) loading 6 buckets with 50K docs each and creating an index in each bucket the idle CPU utilization has dropped from 19% down to 8%. But better yet using collections in a single bucket you can support 40+ collections in the same bucket with an idle CPU utilization of just 8%.
Note that statistics are now processed by prometheus as such the prior advice on changing static_config is no longer applicable in 7.X (and most like no necessary). Thus different parameters control the frequency of collection in prometheus DM me directly is you need directions using the REST API to alter the prometheus scrape intervals.
Best
Jon Strabala
Principal Product Manager - Server‌