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

[7.0] Make thread pool thread timeouts configurable #92987

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

kouvel
Copy link
Member

@kouvel kouvel commented Oct 4, 2023

  • Port of Make thread pool thread timeouts configurable #92985 to 7.0 with some changes to accommodate differences in the thread pool implementations. This version covers both the native and managed thread pools, including the native IOCP thread pool.
  • Added two config options, one that configures the worker and wait thread timeouts, and another that enables keeping some number of worker threads alive after they are created
  • This enables services that take periodic traffic to keep some worker threads around for better latency, while allowing extra threads to time out as appropriate for the service

Customer Impact

These config capabilities were requested by a 1p customer for a scenario where a service takes work in waves and is experiencing noticeably high latency with thread pool worker and IOCP threads being torn down and recreated between waves. The config vars enable the service to keep some number of threads always alive, and to increase the timeout for any extra threads that are created.

Regression?

No

Testing

Verified the default behavior hasn't changed when not configured, and verified using events that the config values are working as expected.

Risk

Low. The change is a bit larger in .NET 7 and .NET 6 because it also covers the native worker and IOCP thread pools. The mechanism for configuring is slightly different to allow both the native and managed thread pools to use the same config vars, though similar to before / other config vars.

- Added two config options, one that configures the worker and wait thread timeouts, and another that enables keeping some number of worker threads alive after they are created
- This enables services that take periodic traffic to keep some worker threads around for better latency, while allowing extra threads to time out as appropriate for the service
@ghost
Copy link

ghost commented Oct 4, 2023

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Port of Make thread pool thread timeouts configurable #92985 to 7.0 with some changes to accommodate differences in the thread pool implementations. This version covers both the native and managed thread pools, including the native IOCP thread pool.
  • Added two config options, one that configures the worker and wait thread timeouts, and another that enables keeping some number of worker threads alive after they are created
  • This enables services that take periodic traffic to keep some worker threads around for better latency, while allowing extra threads to time out as appropriate for the service

Customer Impact

These config capabilities were requested by a 1p customer for a scenario where a service takes work in waves and is experiencing noticeably high latency with thread pool worker and IOCP threads being torn down and recreated between waves. The config vars enable the service to keep some number of threads always alive, and to increase the timeout for any extra threads that are created.

Regression?

No

Testing

Verified the default behavior hasn't changed when not configured, and verified using events that the config values are working as expected.

Risk

Low. The change is a bit larger in .NET 7 and .NET 6 because it also covers the native worker and IOCP thread pools. The mechanism for configuring is slightly different to allow both the native and managed thread pools to use the same config vars, though similar to before / other config vars.

Author: kouvel
Assignees: kouvel
Labels:

area-System.Threading

Milestone: 7.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Oct 9, 2023
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we will take for consideration in 7.0.x

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 9, 2023
@kouvel kouvel merged commit 341b81c into dotnet:release/7.0-staging Oct 11, 2023
175 of 178 checks passed
@kouvel kouvel deleted the TpThreadTimeoutConfig7 branch October 11, 2023 22:32
@ghost ghost locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Threading Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants