Details
-
Bug
-
Resolution: Fixed
-
Major
-
Elixir
-
macOS
-
Untriaged
-
0
-
Unknown
Description
When testing thread usage statistics (MB-20017), I observed that Magma's compactor threads appear to all wake up every ~2mins and consume a significant amount of CPU (40% of one core) for around 30s:
Note this is on a totally idle system with:
- One node running via cluster_run
- 10 Buckets (Magma, 1024MB quota each)
- 10,000 documents loaded into each bucket (1024 Bytes each)
I would expect the CPU usage of magma should be essentially zero in this situation.
This is a significant issue for high bucket density (e.g. Elixir serverless) as we need Magma (and all other components') CPU usage to be proportional to the amount of work the user is performing as we cannot charge them if they are not performing any operations.
Steps to Reproduce
- Start and initialise a single node cluster:
./cluster_run -n1 --dont-rename
./cluster_connec -n2
- Delete the default couchstore bucket, then create 10x Magma buckets with 1024MB quota each
- Load documents into each bucket:
for n in $(seq 1 10); do cbc-pillowfight -U couchbase://localhost:12000/magma_${n} -u Administrator -P asdasd --num-threads=1 --min-size=1024 --max-size=1024 --set-pct 100 --num-items 10000 --populate-only; done
- Leave the cluster idle, and monitor CPU usage.
Logs: magma_high_idle_cpu.zip