Skip to content
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

[Improve][TubeMQ] Replace the while-sleep with ScheduledExecutorService for tube server loopProcess #5907

Closed
2 tasks done
liangyepianzhou opened this issue Sep 15, 2022 · 0 comments · Fixed by #5908
Closed
2 tasks done

Comments

@liangyepianzhou
Copy link
Contributor

Description

Java threads are implemented using kernel threads, and the sleep and wake-up (state switching) of threads need to be performed by the operating system, which is an extremely time-consuming and labor-intensive operation. In the scenario where the thread sleeps or runs for a long time, its impact on performance is not obvious, because the switching of thread state is not frequent. However, if the thread sleep and running time are very short (such as milliseconds/second), the system will frequently switch the thread state, resulting in serious performance loss and enlargement with the increase of the number of loops.

We hope to replace the while-sleep with ScheduledExecutorService to execute the scheduled task in AbstractDaemonService::loopProcess.

InLong Component

InLong TubeMQ

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Code of Conduct

@liangyepianzhou liangyepianzhou changed the title [Improve][TubeMQ] Replace the while-sleep with ScheduledExecutorService in [Improve][TubeMQ] Replace the while-sleep with ScheduledExecutorService for tube server loopProcess Sep 15, 2022
@healchow healchow added this to the 1.4.0 milestone Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment