You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While creating a HystrixCommand, a thread pool will be acquired and HystrixThreadPoolDefault.touchConfig() will be executed by default. In HystrixThreadPoolDefault.touchConfig(), threadPool.setCorePoolSize(dynamicCoreSize) will be executed.
In Java 6, threadPool.setCorePoolSize(dynamicCoreSize) will execute a lock operation all the time. That is negative for the performance and sometimes in the high load scenario will cause a live lock issue.
In Java 7 & 8, if the max size is greater than the core size (it is not the default scenario, but someone can have the custom thread pool), the idle worker threads will be interrupted. I think it is unnecessary if the core pool size is not changed.
So I think before execute setCorePoolSize, the new core pool size should be compared the original one to decide the necessity of the execution of setCorePoolSize
The text was updated successfully, but these errors were encountered:
I didn't know either of those facts - thanks for bringing this up! Your proposal sounds like a good one. Are you interested in submitting a PR? I'm happy to review, if so. Otherwise, I can get to it before I cut the next release.
While creating a HystrixCommand, a thread pool will be acquired and
HystrixThreadPoolDefault.touchConfig()
will be executed by default. InHystrixThreadPoolDefault.touchConfig()
,threadPool.setCorePoolSize(dynamicCoreSize)
will be executed.In Java 6,
threadPool.setCorePoolSize(dynamicCoreSize)
will execute a lock operation all the time. That is negative for the performance and sometimes in the high load scenario will cause a live lock issue.In Java 7 & 8, if the max size is greater than the core size (it is not the default scenario, but someone can have the custom thread pool), the idle worker threads will be interrupted. I think it is unnecessary if the core pool size is not changed.
So I think before execute
setCorePoolSize
, the new core pool size should be compared the original one to decide the necessity of the execution ofsetCorePoolSize
The text was updated successfully, but these errors were encountered: