Introduction to DynamicTp

DynamicTp is a lightweight dynamic thread pool monitoring and management tool based on the configuration center. Its main functions can be summarized into several categories, such as dynamic parameter adjustment, notification and alarm, operation monitoring, and third-party package thread pool management.

After several iterations, the latest version v1.1.2 has the following features

  • code zero intrusion: We have changed the previous usage posture of the thread pool. All configurations are placed in the configuration center. When the service is started, the configuration will be pulled from the configuration center to generate a thread pool object and placed in the Spring container. When using it, it will be directly obtained from the Spring container. code zero intrusion

  • notification alarm: Provides multiple alarm dimensions (configuration change notification, activity alarm, capacity threshold alarm, rejection trigger alarm, task execution or waiting timeout alarm), supports enterprise WeChat, DingTalk, Feishu, and email alarms, and provides an SPI interface to automatically Define extension implementation

  • Operation monitoring: Timely collection of thread pool indicator data, supports three ways of MicroMeter, JsonLog log output, and Endpoint, and can be realized through custom extensions of the SPI interface

  • task enhancement: Provide task packaging function, just implement the TaskWrapper interface, such as MdcTaskWrapper, TtlTaskWrapper, SwTraceTaskWrapper, which can support thread pool context information transfer

  • Multi-configuration center support: Realize dynamic adjustment of thread pool parameters based on the mainstream configuration center, which takes effect in real time, supports Nacos, Apollo, Zookeeper, Consul, Etcd, Polaris, ServiceComb, and also provides SPI interface for custom extension implementation

  • Middleware thread pool management: Integrated management of thread pools of commonly used third-party components, has integrated thread pool management of components such as Tomcat, Jetty, Undertow, Dubbo, RocketMq, Hystrix, Grpc, Motan, Okhttp3, Brpc, Tars, SofaRpc, RabbitMq (parameter adjustment, monitoring and alarming) )

  • lightweight and simple: Based on the implementation of SpringBoot, the starter is introduced, and the access can be completed in only 4 simple steps, and it can be completed in 3 minutes.

  • multimodal: Refer to the Tomcat thread pool to provide the EagerDtpExecutor thread pool used in IO-intensive scenarios

  • compatibility: JUC ordinary thread pool and ThreadPoolTaskExecutor in Spring can also be monitored by the framework, just add @DynamicTp annotation when @Bean is defined

  • reliability: The thread pool provided by the framework implements the Spring life cycle method, which can process as many tasks in the queue as possible before the Spring container is closed

  • Highly scalable: The core functions of the framework provide SPI interface for user-defined personalized implementation (configuration center, configuration file parsing, notification alarm, monitoring data collection, task packaging, etc.)

  • Large-scale online application: Referring to the practice of Meituan’s thread pool, Meituan already has mature application experience of this theory

Technology Architecture

v1.1.2 release record

Features

  • Increase the ability to dynamically adjust the parameters of the juc thread pool, thanks to @wenpan for his contribution

  • Added ScheduledDtpExecutor, thanks to @WindSearcher’s contribution

  • Add support for polaris in the spring-cloud-tencent configuration center, thanks to @fabian4 for his contribution

  • Increase the management of rocketmq producer thread pool, thanks to @fabian4 for his contribution

  • Increase the management of rabbitmq consumption thread pool, thanks to @fabian4 for his contribution

  • Add print tid to the log output & alarm information in scenarios such as task execution timeout and rejection, thanks to @kyao for his contribution

  • Add support for spring-cloud-huawei configuration center servicecomb, thanks to @WindSearcher for his contribution

  • The id field is added to platfrom, multiple notification platforms can be configured, and corresponding alarm groups can be pushed according to the configuration, thanks to @KamToHung for his contribution

  • StreamRocketMqDtpAdapter increases the management of producer thread pool, thanks to @hailang’s contribution

Bugfixes

  • Fix the bug of alibaba dubbo initialization error assignment, thanks to @WindSearcher’s contribution

  • Fix the incompatibility between high and low version of webserver undertow, thanks to @WindSearcher for his contribution

  • Fix the AnnotatedBeanDefinition coercion failure problem in the DtpPostProcessor class, thanks to @文潘锋 for his contribution

Optimize

  • jackson-databind version upgrade

  • hutool version upgrade 5.8.12

  • Optimization Under JDK8, when corePoolSize is 0, ScheduledThreadPoolExecutor will cause an infinite loop problem, thanks to the contribution of @WindSearcher

  • Optimize the way to obtain the local ip address, thanks to @yaokai for his contribution

  • When the task submitted by optimize submit is abnormal, it cannot be handled by UncaughtExceptionHandler, thanks to @dailingx for his contribution

  • Optimize the third-party adapter class only when the dynamicTP switch is turned on, thanks to @hkhuang for his contribution

  • Start optimization, only use @EnableDynamicTp to decide whether to use dtp at startup, thanks to @KamToHung’s contribution

  • Log output optimization

  • Partial code optimization refactoring

project address

official website: https://dynamictp.cn

gitee address: https://gitee.com/dromara/dynamic-tp

github address: https://github.com/dromara/dynamic-tp

join the community

Seeing this, give the project a star if it is convenient, your support is our driving force!

If you have any questions during use, or if you have any ideas or suggestions for the project, you can join the community and discuss with your friends.

Wechat group is full of 200 people, you can add my personal wechat yanhom1314 Pull group (remark: dynamic-tp).

#Dynamic #thread #pool #DynamicTp #v112 #released #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *