[dev] change threadpool config

This commit is contained in:
朱八 2020-08-02 01:01:34 +08:00
parent 14b556fe3a
commit b31b4a819f
2 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,7 @@ public class ThreadPoolConfig {
public Executor initBackgroundPool() { public Executor initBackgroundPool() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(Runtime.getRuntime().availableProcessors()); executor.setCorePoolSize(Runtime.getRuntime().availableProcessors());
executor.setMaxPoolSize(Runtime.getRuntime().availableProcessors()); executor.setMaxPoolSize(Runtime.getRuntime().availableProcessors() * 2);
executor.setQueueCapacity(8192); executor.setQueueCapacity(8192);
executor.setKeepAliveSeconds(60); executor.setKeepAliveSeconds(60);
executor.setThreadNamePrefix("omsBackgroundPool-"); executor.setThreadNamePrefix("omsBackgroundPool-");

View File

@ -193,6 +193,7 @@ public class InstanceLogService {
try { try {
instanceId2LastReportTime.remove(instanceId); instanceId2LastReportTime.remove(instanceId);
CommonUtils.executeWithRetry0(() -> localInstanceLogRepository.deleteByInstanceId(instanceId)); CommonUtils.executeWithRetry0(() -> localInstanceLogRepository.deleteByInstanceId(instanceId));
log.warn("[InstanceLog-{}] delete local instanceLog successfully.", instanceId);
}catch (Exception e) { }catch (Exception e) {
log.warn("[InstanceLog-{}] delete local instanceLog failed.", instanceId, e); log.warn("[InstanceLog-{}] delete local instanceLog failed.", instanceId, e);
} }