错误日志:
2019-01-28 09:42:10.623 ERROR 16056 --- [ job-event-9] c.d.d.job.event.rdb.JobEventRdbStorage : wait millis 18, active 8, maxActive 100, creating 1, runningSqlCount 2 : INSERT INTO `JOB_STATUS_TRACE_LOG` (`id`, `job_name`, `original_task_id`, `task_id`, `slave_id`, `source`, `execution_type`, `sharding_item`, `state`, `message`, `creation_time`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
runningSqlCount 2 : INSERT INTO `JOB_EXECUTION_LOG` (`id`, `job_name`, `task_id`, `hostname`, `ip`, `sharding_item`, `execution_source`, `is_success`, `start_time`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
runningSqlCount 1 : SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id = 'OrderExpireJob-0019@-@0@-@READY@-@10.40.3.22@-@16056' and state='TASK_STAGING'
runningSqlCount 1 : SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id = 'OrderExpireJob-0020@-@0@-@READY@-@10.40.3.22@-@16056' and state='TASK_STAGING'
解决方法:
将maxWait: 由10改为200
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
filters: stat
# maxActive: 500
maxActive: 100
initialSize: 5
maxWait: 200
#maxWait: 10
minIdle: 5
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: listByCategoryId 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
本文记录了一次错误日志分析过程,发现数据库连接池等待时间设置过短导致的问题。通过调整maxWait参数,从10毫秒增加到200毫秒,解决了因SQL执行过多而导致的等待超时问题。
1378

被折叠的 条评论
为什么被折叠?



