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

Issue 7303: Adding changes for elastic thread pool for LTS processing #7304

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Amit-Singh40
Copy link
Contributor

@Amit-Singh40 Amit-Singh40 commented Nov 2, 2023

Change log description
Currently we use fixed sized to thread pool for the LTS which needs to changed to elastic thread pool which can grow and shrink accordingly.

Purpose of the change
Fixes #7303

What the code does
Enables elastic thread pool for LTS.

How to verify it
NA

Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
@Amit-Singh40 Amit-Singh40 marked this pull request as draft November 2, 2023 17:02
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (a6bba01) 85.97% compared to head (fe59cfe) 85.97%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7304   +/-   ##
=========================================
  Coverage     85.97%   85.97%           
- Complexity    16310    16313    +3     
=========================================
  Files          1042     1042           
  Lines         60994    61004   +10     
  Branches       6191     6191           
=========================================
+ Hits          52437    52451   +14     
+ Misses         5354     5353    -1     
+ Partials       3203     3200    -3     
Files Coverage Δ
...vega/common/concurrent/ExecutorServiceFactory.java 89.18% <100.00%> (ø)
...concurrent/ThreadPoolScheduledExecutorService.java 84.17% <100.00%> (+0.34%) ⬆️
...vega/segmentstore/server/store/ServiceBuilder.java 80.74% <100.00%> (+0.28%) ⬆️
...avega/segmentstore/server/store/ServiceConfig.java 95.80% <100.00%> (+0.10%) ⬆️
...vega/common/concurrent/ExecutorServiceHelpers.java 62.74% <50.00%> (-1.26%) ⬇️

... and 20 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Amit-Singh40 Amit-Singh40 marked this pull request as ready for review November 3, 2023 08:07
Copy link
Contributor

@RaulGracia RaulGracia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that both the PR and the original issue need more description of the purpose and expectations of this change. Also, I don't see how the tests are actually verifying the correct behavior of the thread pool dynamic number of threads. Finally, I think it would be required a performance comparison of Pravega with and without this change to see if it induces any regression.

@@ -42,7 +42,9 @@ public class ServiceConfig {
public static final Property<Integer> CONTAINER_COUNT = Property.named("container.count", null, "containerCount");
public static final Property<Integer> PARALLEL_CONTAINER_STARTS = Property.named("container.parallelStarts", 2);
public static final Property<Integer> THREAD_POOL_SIZE = Property.named("threadPool.core.size", 30, "threadPoolSize");
public static final Property<Integer> STORAGE_THREAD_POOL_SIZE = Property.named("threadPool.storage.size", 200, "storageThreadPoolSize");
public static final Property<Integer> STORAGE_THREAD_POOL_SIZE = Property.named("threadPool.storage.size", 50, "storageThreadPoolSize");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are changing default thread pool sizes without any evidence on how this is going to impact the performance of moving data to LTS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raised this PR for review, meanwhile I will be running the performance.

@@ -64,7 +64,7 @@ public void testGetDetectionLevel() {

@Test
public void testScheduledThreadPoolLeak() {
testLeaks(factory -> (ThreadPoolScheduledExecutorService) factory.newScheduledThreadPool(1, "test", 1));
testLeaks(factory -> (ThreadPoolScheduledExecutorService) factory.newScheduledThreadPool(new ThreadPoolExecutorConfig(1, 1), "test", 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be testing the "dynamic change" of threads. I think you may need to add new tests to check if the threads in the pool are changing according to what you expect.

Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Copy link
Contributor

@sachin-j-joshi sachin-j-joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me.
I have some minor style/format related comments.

Please update the PR with basic details of outcome of performance verification/experiments.
Please add more unit tests to more directly verify case of elastic threadpool

Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
Signed-off-by: Amit-Singh40 <amit.singh30@dell.com>
@Amit-Singh40 Amit-Singh40 marked this pull request as draft December 14, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throttle - Perf - LTS - Use elastic thread pool for LTS processing.
4 participants