Couchbase high memory & cpu usage on Docker Rocky Linux 9

Hi everyone,

My current server:

  • OS: Rocky Linux 9.
  • Docker engine: 26.1.4
  • Cgroup v2

I’m just run Couchbase 7.2.6 on my server and initialize cluster with 3Gb cluster ram size, one bucket with 2Gi bucket ram size. After that I see Couchbase consumes a lot of memory and cpu on idle state.


I also run another Rocky Linux 9 on my machine using Vagrant and meet the same result :frowning: .

I have run Couchbase on CentOS 7 with no problem about high memory & cpu usage.
Below is the stats with same setup but on CentOS 7
image

I have run docker info on Cent OS 7 and Rocky Linux 9 and it seems Rocky Linux 9 has cgroup driver systemd and cgroup v2 while Cent OS 7 has cgroup driver cgroupfs and cgroup v1.

So what is the exactly problem?
Thank you for reading my question :smile: .
Any help I appreciate.

Hi @vng.mps.quannlm it’s not immediately clear why this would be the case. Maybe try accessing the container and finding what processes are using the CPU:

sudo docker exec -it safari_couchbase bash
# Then inside the container:
apt update
apt install htop
htop

Hi there, I access the container and install htop, below is the stats when I run htop inside the Couchbase container:


And dokcer stats:

Currently my bucket only has 3 items.
So do you know why beam.smp consumes memory so much? I realy don’t know how to solve it :frowning:

Hi @graham.pople,

we have a similar issue. We ran a 3 node cluster with Couchbase CE 7.2 on Oracle Linux 7 for four years without any problems.
Now we migrated to using Couchbase CE 7.6.2 with Docker on Oracle Linux 9 and the system memory usage on the nodes is always near or over 85 %. We tried many different quota settings regarding the Data Service, Query Service and Index Service, but the memory always climbs very high. On the previous environment without Docker the memory was always between 50 and 60 percent. All nodes in both environments have/had 4 cores and 16 GB RAM.
Additionally, we get always indexer warnings like in the new environment:
“Warning: approaching low index resident percentage. Indexer RAM percentage on node “” is 0%, which is under the threshold of 10%.” All indexes have a resident ratio of 0%! The indexer process is using much more memory than the value set in the quota of the Index Service in the Couchbase UI and the three “beam.smp” processes use about 12%, 10.5% and 10.3% percent of the system memory. We also tried to limit the memory of the Docker Couchbase containers but they reached this limit and failed.
What can be done to get the memory usage down?

Thank you in advance.

we migrated to using Couchbase CE 7.6.2 with Docker

On the previous environment without Docker the memory was always between 50 and 60 percent.

Doesn’t that indicate that the issue is Docker?

Is 7.6.4 any better?

There is an API to force gc on a query node …

curl -u $USER:$PASSWORD $QUERY_NODE_URL/admin/gc

QUERY_NODE_URL is something like http://queryhost1:8093 or https://queryhost1:18093