Problem with high CPU spikes

Hi everyone,

I’ve been experiencing (periodic) high CPU spikes (lasting around 2 seconds) with my RabbitMQ broker (version 3.12.0) running on Erlang 25.3.2.2. The setup consists of a system with 4 CPU cores, 8GB RAM, and 64GB of disk space. It operates within a Docker environment, which hosts a total of 37 containers. Among these containers, an InfluxDB instance utilizes Telegraf, which is the sole consumer for gathering metrics from the RabbitMQ broker. Grafana is used for visualization.

Notably, both the CPU load and message throughput are low. Additionally, there are no spikes observed in garbage collection or in IO activities. The broker uses a single topic exchange that routes messages to one queue with the following settings: prefetch count of 100 and queue max length of 10,000.

__________________________________________________________________________________

My rabbitmq.conf is as follows:

– loopback_users.guest = false

– listeners.tcp.default = 5672 

– management.tcp.port = 15672 

– mqtt.listeners.tcp.default = 1883 

– mqtt.allow_anonymous = true 

– mqtt.vhost = / 

– mqtt.exchange = amq.topic 

– mqtt.subscription_ttl = 86400000 

– mqtt.prefetch = 10

__________________________________________________________________________________

  Additionally, I have tried the following settings without any noticeable change:  

– vm_memory_high_watermark = 0.6 

– vm_memory_high_watermark_paging_ratio = 0.5 

– disk_free_limit = 2.5 GB 

– queue_index_embed_msgs_below = 4096  

__________________________________________________________________________________

  I also attempted the following Erlang settings (without success):

+S 4 

+scl true (only if “+sub false”) 

+sub true 

+sbt db 

+sbwt none 

+sbwtcpu none 

+sbwtdio none 

+smp enable 

+K true

__________________________________________________________________________________



As someone relatively new to RabbitMQ, I’m struggling to identify the root cause of these CPU spikes. Could anyone offer some advice on potential causes or suggest tools/approaches to further diagnose these spikes, possibly at the background process level?

Thank you in advance for your help!  

Read more here: Source link