-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Implementation for feature request #1013 #1032
Implementation for feature request #1013 #1032
Conversation
…l size + test case
NetflixOSS » Hystrix » Hystrix-pull-requests #291 SUCCESS |
This looks like a good change. The only concern I have is that all other properties offer Archaius integration, which allows for on-the-fly reconfiguration. Is that something you're willing to look at? |
I have looked into this. There is only one TimerThreadPool (HystrixTimer) that handles timeouts for multiple ThreadPools based on HystrixThreadPoolKey. Putting this setting in the HystrixThreadPoolProperties class would therefore not a be clean solution. This setting is also neither a CommandProperty nor a CollapserProperty. |
I just ran into that issue. What's the rationale behind setting the number of threads in the TimerThreadPool to the number of available processors? |
@tine2k My personal preference is WDYT? |
@lixlix Good question. I didn't make that design choice initially, and it's not documented either. My guess would be that this choice was made based on the observation that work done by the system should be scaling roughly by the number of CPUs, and so the timer threads should scale with this value as well. Mostly due to the fact there's not a configuration knob, I haven't experimented with different values for the thread pool size. Do you have any insight on a good mechanism to choose the timer thread pool size? |
@mattrjacobs No insight on my side - that was why I was asking for the design decision behind that. Scaling that way doesn't make too much sense, I think. |
@mattrjacobs I agree. @mattrjacobs @lixlix I don't think this is a good default either. If I understand the mechanism correctly, the timer thread pool is for handling timeouts of actions until the circuit opens. If the circuit is open, actions will fail right away and the timer thread pool is no longer used. Therefore, you require a large timer thread pool only if you have a lot of timeouts to deal with (e.g. if circuit breaking is disabled). Furthermore, timeout handling is a cheap operation compared to the usual |
I don't disagree with the flat number of threads approach. I'd like to do some experiments (both using jmh and Netflix production apps) to see what happens when we limit the threads. I also wanted to point out that Hystrix collapsing uses the HystrixTimer threads. Those threads generate ticks and then performing the batching |
… pool properties with archaius support, unit test
NetflixOSS » Hystrix » Hystrix-pull-requests #301 FAILURE |
@mattrjacobs I updated the branch with a |
NetflixOSS » Hystrix » Hystrix-pull-requests #302 SUCCESS |
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertNull; | ||
import static org.junit.Assert.assertTrue; | ||
import com.netflix.hystrix.Hystrix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
I left a couple of small cosmetic comments, but this looks great! Thanks for doing the extra work to get Archaius integration. |
Merging. Will issue the cleanup as a separate commit. Thanks, @tine2k! |
Implementation for feature request #1013
Cleanup unused imports from #1032
Thanks for your review notes, @mattrjacobs. Sorry, I couldn't work them in in time (I would have). Anyways, thanks for the merge! |
I implemented a simple way to configure the timeout thread pool core size via a system property. The default is still Runtime.getRuntime(). availableProcessors(). I also added test cases for this feature.