-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
HashedWheelTimer cost too many CPU times #311
Comments
I also encountered the same problem,where I just ran a example project-CounterServer。And I found HashedWheelTimer cost too much cpu resource。 |
It looks that a bug in HashedWheelTimer on windows platform, we will look into it, thanks. |
Caused by windows generating an interrupt when java called Thread.sleep() and is solved by not sleeping if the time is lower than 10 ms, and this may cause high cpu |
Currently, VoteTimer, ElectionTimer, StepDownTimer and SnapshotTimer use HashedWheelTimer class, but it seems that JDK ScheduledExecutorService API is enough, there is no special requirement to use HashedWheelTimer |
Maybe we should implement #269 and replace the HWT @SteNicholas |
I fixed this sleepTime issue on windows, for detail, please access the following URL, |
@michaelmao999 I don't have a windows, but I think |
Maybe the above code is better? Avoid calling Thread.sleep() multiple times |
Sounds good. |
@michaelmao999 can you send a PR for this? |
Describe the bug
When launching BenchmarkServer, only one instnce cost 39-67% CPU times.
After launching 3 instances, it cost 100% CPU times.
Environment
java -version
): JDK 1.8.202uname -a
): Windows 10The text was updated successfully, but these errors were encountered: