rev 优化线程相关
This commit is contained in:
@@ -7,7 +7,6 @@ spring:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
# active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
@@ -44,7 +43,7 @@ spring:
|
||||
enable_lazy_load_no_trans: true
|
||||
dynamic:
|
||||
tp:
|
||||
enabled: false # 是否启用 dynamictp,默认true
|
||||
enabled: true # 是否启用 dynamictp,默认true
|
||||
enabledBanner: false # 是否启用 控制台banner,默认true
|
||||
enabledCollect: true # 是否开启监控指标采集,默认true
|
||||
collectorTypes: logging,test_collect # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
|
||||
@@ -57,30 +56,23 @@ spring:
|
||||
keepAliveTime: 60
|
||||
runTimeout: 10000
|
||||
queueTimeout: 100
|
||||
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警、拒绝报警、任务超时报警)
|
||||
- type: change
|
||||
enabled: true
|
||||
|
||||
- type: capacity # 队列容量使用率,报警项类型,查看源码 NotifyTypeEnum枚举类
|
||||
enabled: true
|
||||
threshold: 80 # 报警阈值,默认70,意思是队列使用率达到70%告警
|
||||
interval: 120 # 报警间隔(单位:s),默认120
|
||||
|
||||
- type: liveness # 线程池活性
|
||||
enabled: true
|
||||
threshold: 80 # 报警阈值,默认 70,意思是活性达到70%告警
|
||||
|
||||
- type: reject # 触发任务拒绝告警
|
||||
enabled: true
|
||||
threshold: 100 # 默认阈值10
|
||||
|
||||
- type: run_timeout # 任务执行超时告警
|
||||
enabled: true
|
||||
threshold: 100 # 默认阈值10
|
||||
|
||||
- type: queue_timeout # 任务排队超时告警
|
||||
enabled: true
|
||||
threshold: 100 # 默认阈值10
|
||||
executors: # 动态线程池配置,都有默认值,采用默认值的可以不配置该项,减少配置量
|
||||
- threadPoolName: dtpExecutor1 # 线程池名称,必填
|
||||
threadPoolAliasName: core_thread # 线程池别名,可选
|
||||
executorType: common # 线程池类型 common、eager、ordered、scheduled、priority,默认 common
|
||||
corePoolSize: 10 # 核心线程数,默认1
|
||||
maximumPoolSize: 30 # 最大线程数,默认cpu核数
|
||||
queueCapacity: 1024 # 队列容量,默认1024
|
||||
queueType: VariableLinkedBlockingQueue # 任务队列,查看源码QueueTypeEnum枚举类,默认VariableLinkedBlockingQueue
|
||||
rejectedHandlerType: CallerRunsPolicy # 拒绝策略,查看RejectedTypeEnum枚举类,默认AbortPolicy
|
||||
keepAliveTime: 30 # 空闲线程等待超时时间,默认60
|
||||
threadNamePrefix: core_thread # 线程名前缀,默认dtp
|
||||
allowCoreThreadTimeOut: true # 是否允许核心线程池超时,默认false
|
||||
waitForTasksToCompleteOnShutdown: true # 参考spring线程池设计,优雅关闭线程池,默认true
|
||||
awaitTerminationSeconds: 5 # 优雅关闭线程池时,阻塞等待线程池中任务执行时间,默认3,单位(s)
|
||||
preStartAllCoreThreads: false # 是否预热所有核心线程,默认false
|
||||
runTimeout: 2000 # 任务执行超时阈值,单位(ms),默认0(不统计)
|
||||
queueTimeout: 1000 # 任务在队列等待超时阈值,单位(ms),默认0(不统计)
|
||||
task:
|
||||
pool:
|
||||
# 核心线程池大小
|
||||
@@ -137,7 +129,7 @@ security:
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
mapper-locations:
|
||||
- classpath:org.nl.**.mapper/*.xml
|
||||
global-config:
|
||||
|
||||
Reference in New Issue
Block a user