Ways to reduce idle CPU usage #9988
-
Describe the bugHello, I debugged rabbitmq, and there is literally nothing ongoing, no messages at all. This is bothering me, so I tried to fiddle with the configurations of rabbitmq, but it does not seem that any of the many settings has an impact on the idle CPU usage of rabbit. Is this expected? Anything I can do about it? I tried various container releases including latest and also the distributed debian package (without docker) all with the same result that the idle CPU usage is relatively high. Reproduction steps
Expected behaviorI would expect substantially less CPU resources used when being idle. Additional contextRunning rabbitmq on a debian server. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
@daniel86 CPU usage of 0.2% or 0.3% (and this is very likely 0.3% of just one core) is hardly excessive. A node that does not accept, route or delivery any messages still emits and collects metrics periodically. You do not mention what specific settings you have tried but there is a dedicated doc section Those running on CentOS Stream 9 and not expecting a lot of connections can also take a look at this blog post. |
Beta Was this translation helpful? Give feedback.
-
@michaelklishin I did not say the usage is excessive. but relatively high which is visible in the grafana screenshot. I gladly provide more details. I did follow the page you mentioned before, without success (I invested like two days going through all the material I could find). Here is the docker compose configuration I use:
The content of
so I disabled all the metrics plugin without any apparent change in idle CPU usage to my surprise. I played a lot with all the settings in the configuration file, the one currently mounted in the container has these entries:
nothing of above appears to have influence on idle CPU usage. The log of rabbit suggests it adopts my configuration:
|
Beta Was this translation helpful? Give feedback.
-
There are certain things in the above settings that are unnecessary or counterproductive:
Using Monitoring tools scrape data from the Prometheus endpoint every so often. Some tools monitor with The quest to bringing down a RabbitMQ node's CPU usage down to zero will likely have consequences for monitoring, so beyond the two key recommendations above, you have to ask yourself if this is really worth the gains. |
Beta Was this translation helpful? Give feedback.
@daniel86 CPU usage of 0.2% or 0.3% (and this is very likely 0.3% of just one core) is hardly excessive.
A node that does not accept, route or delivery any messages still emits and collects metrics periodically.
You do not mention what specific settings you have tried but there is a dedicated doc section
on reducing CPU usage on mostly idle systems.
Those running on CentOS Stream 9 and not expecting a lot of connections can also take a look at this blog post.