RabbitMQ:erl.exe 占用高 CPU 使用率 [英] RabbitMQ: erl.exe taking high CPU usages

查看:317
本文介绍了RabbitMQ:erl.exe 占用高 CPU 使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序中实现了 rabbitmq 并且它在 windows server 2008 服务器上运行,问题是 erl.exe 占用了高 CPU 使用率,例如有时它达到 40-45% CPU 使用率,即使在理想情况下(不处理时)任何队列)至少需要 4-15% 的 CPU 使用率.

I have implemented rabbitmq in my application and it's running on windows server 2008 server, the problem is that erl.exe taking high CPU usages like sometime it reaches 40-45% CPU usages, even in the ideal case (when not processing any queue) it takes at least 4-15% CPU usages.

占用高 CPU 使用率的原因可能是什么?是否有任何设置或我需要做的任何其他事情.

What could be the reason for taking high CPU usages? Is there any setting or any other thing that I need to do.

推荐答案

您说即使不处理队列,它仍然是 4-15%,但是您的应用程序是否正在运行?如果您以前没有,请尝试在没有应用程序使用 Rabbit 时监控 erl.

You say that even when not processing a queue it is still at 4-15%, but is your application running? If you weren't before, try to monitor erl while no application is using Rabbit.

想到的一件事是您可能在循环中使用 QueingBasicConsumer,这可能会增加 CPU 使用率.如果您正在使用 QueingBasicConsumer 并且它是导致命中的原因,请尝试将其替换为 EventingBasicConsumer(这样您就不会忙于等待)并查看是否有改进.

One thing that comes to mind is that you might be using the QueingBasicConsumer in a loop and that could be contributing to the CPU usage. If you are using QueingBasicConsumer and it is what is causing the hit, try substituting it with EventingBasicConsumer (such that you don't do busy waiting) and see if you have improvement.

另外,您的应用程序如何使用 Rabbit?根据文档,每个 IConnection 都由后台线程备份,如果您在您的应用程序中重新创建一堆连接,这可能是速度变慢的另一个原因.

Also, how is your application using Rabbit? According to the documentation every IConnection is backed up by a background thread and if you're creating a bunch of connections in your application it could be another reason for the slow down.

这篇关于RabbitMQ:erl.exe 占用高 CPU 使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆