Dynamic-tp is a lightweight dynamic thread pool framework that enables runtime adjustment of thread pool parameters through configuration centers.
The tool addresses the challenge of configuring thread pool parameters without visibility into their behavior. Standard ThreadPoolExecutor requires developers to guess optimal core parameters upfront, and any needed adjustments demand code changes and redeployment. Dynamic-tp solves this by integrating with distributed configuration centers—Nacos, Apollo, Zookeeper, Consul, and Etcd—to push parameter changes in real time without requiring application restarts. The framework wraps ThreadPoolExecutor and exposes its built-in set/get methods as dynamic modification points, allowing core parameters to be tuned at runtime. It adds monitoring and alerting capabilities to make thread pool behavior visible during operation, addressing the black-box nature of standard thread pools.
Projects with multiple thread pools handling varied workloads—IO-intensive and CPU-intensive tasks—benefit most from this approach. Teams already running a configuration center can adopt dynamic-tp with minimal overhead, since it leverages existing infrastructure rather than requiring a separate management system. The tool is particularly suited to microservice architectures where configuration governance is already established. It provides unified management of third-party thread pools used by frameworks like Dubbo, gRPC, and RocketMQ, consolidating monitoring across the application.
The project maintains active engagement with pull requests and issues receiving responses. Development includes regular updates to support additional configuration centers and integrations with popular frameworks. The codebase demonstrates ongoing refinement of core functionality and expansion of monitoring capabilities through metrics integration.