-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockingWaitStrategy CPU 100% #460
Comments
You should profile the CPU usage just to be sure where the time is being taken. Having said that I suspect that if your first consumer is much slower than your second consumer the second blocking wait strategy will be spinning in this loop waiting for a dependent sequence: https://github.com/LMAX-Exchange/disruptor/blob/master/src/main/java/com/lmax/disruptor/BlockingWaitStrategy.java#L45 In the .NET port there is an implementation that will not use 100% CPU as it will actually sleep the thread occasionally instead of just yielding. |
Thank you for your reply.Maybe I didn't describe it clearly.My business scenario is a simple asynchronous alarm,Each consumer only delivers messages to MQ.There should be no chance of any one being blocked.Let me refer to the implementation.Finally thank you anyway |
I used BlockingWaitStrategy in my code,it makes my project use CPU 100%
I use it for exception alert.Our system tps is not high,Fewer exceptions.
As you know,I didn't use YieldingWaitStrategy,I used BlockingWaitStrategy.
It performed so well for a long time, But today it used up my CPU.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: