-
Notifications
You must be signed in to change notification settings - Fork 191
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
Add thread pool properties #1008
Add thread pool properties #1008
Conversation
@DiegoTavares @roulaoregan-spi Would love to get your feedback on this one. |
I will force-update this to generalize the thread pool settings. |
c60074f
to
7b61b95
Compare
dispatcher.dispatch_pool.core_pool_size=4 | ||
# Maximum number of threads to allow in the pool for various operation. | ||
dispatcher.dispatch_pool.max_pool_size=4 | ||
# Queue capacity for various operation. | ||
dispatcher.dispatch_pool.queue_capacity=500 |
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.
The original values
OpenCue/cuebot/src/main/resources/conf/spring/applicationContext-service.xml
Lines 64 to 66 in 87bcf7a
<property name="corePoolSize" value="4" /> | |
<property name="maxPoolSize" value="4" /> | |
<property name="queueCapacity" value="500" /> |
dispatcher.launch_queue.core_pool_size=1 | ||
# Maximum number of threads to allow in the pool for launching job. | ||
dispatcher.launch_queue.max_pool_size=1 | ||
# Queue capacity for launching job. | ||
dispatcher.launch_queue.queue_capacity=100 |
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.
The original values
OpenCue/cuebot/src/main/resources/conf/spring/applicationContext-service.xml
Lines 58 to 60 in 87bcf7a
<property name="corePoolSize" value="1" /> | |
<property name="maxPoolSize" value="1" /> | |
<property name="queueCapacity" value="100" /> |
dispatcher.manage_pool.core_pool_size=8 | ||
# Maximum number of threads to allow in the pool for management operation. | ||
dispatcher.manage_pool.max_pool_size=8 | ||
# Queue capacity for management operation. | ||
dispatcher.manage_pool.queue_capacity=250 |
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.
The original values
OpenCue/cuebot/src/main/resources/conf/spring/applicationContext-service.xml
Lines 76 to 78 in 87bcf7a
<property name="corePoolSize" value="8" /> | |
<property name="maxPoolSize" value="8" /> | |
<property name="queueCapacity" value="250" /> |
dispatcher.report_queue.core_pool_size=6 | ||
# Maximum number of threads to allow in the pool for handling Host Report. | ||
dispatcher.report_queue.max_pool_size=8 | ||
# Queue capacity for handling Host Report. | ||
dispatcher.report_queue.queue_capacity=1000 |
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.
The original values
OpenCue/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportQueue.java
Lines 35 to 37 in c93e862
private static final int THREAD_POOL_SIZE_INITIAL = 6; | |
private static final int THREAD_POOL_SIZE_MAX = 8; | |
private static final int QUEUE_SIZE_INITIAL = 1000; |
dispatcher.kill_queue.core_pool_size=6 | ||
# Maximum number of threads to allow in the pool for kill frame operation. | ||
dispatcher.kill_queue.max_pool_size=8 | ||
# Queue capacity for kill frame operation. | ||
dispatcher.kill_queue.queue_capacity=1000 |
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.
The original values
OpenCue/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportQueue.java
Lines 35 to 37 in c93e862
private static final int THREAD_POOL_SIZE_INITIAL = 6; | |
private static final int THREAD_POOL_SIZE_MAX = 8; | |
private static final int QUEUE_SIZE_INITIAL = 1000; |
dispatcher.booking_queue.core_pool_size=6 | ||
# Maximum number of threads to allow in the pool for booking. | ||
dispatcher.booking_queue.max_pool_size=6 | ||
# Queue capacity for booking. | ||
dispatcher.booking_queue.queue_capacity=1000 |
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.
The original values
OpenCue/cuebot/src/main/java/com/imageworks/spcue/dispatcher/BookingQueue.java
Lines 36 to 39 in f833ed6
private static final int INITIAL_QUEUE_SIZE = 1000; | |
private static final int THREADS_MINIMUM = 6; | |
private static final int THREADS_MAXIMUM = 6; |
this is ready to review. |
We have a very similar PR on the tube that handles the same issue, but also adds some functionality to the threadpools to avoid repeated tasks and allow being reset without downtime. Will try to get it pushed this week to evaluate how we can merge both changes. |
Sorry for the delay, commented in #1035 (comment) to explain the detail of the root cause and the solution. I think this #1008 is very safe to merge first because this won't change any behavior or the default settings, at all. But this unblocks users can adjust their Cuebot queue settings for their system without modifying source code. If we still need the features from #1035, I can help to merge those onto master after merging #1008. Does it sound reasonable? @bcipriano @DiegoTavares @roulaoregan-spi |
Sounds reasonable to me. As I mentioned in my comment on #1035, IMO both are complimentary |
Sounds reasonable to me as well. |
Could you merge this first? @bcipriano @DiegoTavares @roulaoregan-spi |
Sounds good to me, let's merge it in. |
Problems
Cuebot can barely handle less than a thousand running frames with the default settings.
It can be verified with this warning message.
OpenCue/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java
Lines 294 to 304 in c22fe12
Cuebot kills running frames even though there are no issues on the frames. The cause is
reportQueue
filled up easily due to the very limited number of threads (8) and the PostgreSQL connections (10).Cuebot also fails to dispatch frames from FrameCompleteHandler due to the very limited dispatch pool threads (4).
Solution
This PR will add thread pool properties to allow increasing the number of threads without build.
${dispatcher.dispatch_pool.core_pool_size}
in applicationContext-service.xml, because--spring.config.additional-location
can't override the value. Instead, it's using autowired env to read property values.Example settings
To address the scalability issues.
Definitely YMMV, but some data point with these settings.
Maximum CPU usage: ~200% (2 cores out of 16 cores)
Maximum memory usage: ~24GB (out of 32GB)