From 544c386759f903e57f3c56b83d1bbeeb232ba275 Mon Sep 17 00:00:00 2001 From: Himit_ZH <372347736@qq.com> Date: Sun, 12 Dec 2021 21:02:48 +0800 Subject: [PATCH] change sanbodx process number --- .../src/main/java/top/hcode/hoj/judge/JudgeRun.java | 4 ++-- .../src/main/java/top/hcode/hoj/judge/SandboxRun.java | 2 +- hoj-springboot/JudgeServer/src/main/resources/application.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeRun.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeRun.java index 08412a0b..cb62e5e2 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeRun.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/JudgeRun.java @@ -73,8 +73,8 @@ public class JudgeRun { // 使用线程池开启多线程测试每一测试输入数据 ExecutorService threadPool = new ThreadPoolExecutor( cpuNum, // 核心线程数 - cpuNum + 1, // 最大线程数。最多几个线程并发。 - 1,//当非核心线程无任务时,几秒后结束该线程 + cpuNum * 2, // 最大线程数。最多几个线程并发。 + 2,//当非核心线程无任务时,几秒后结束该线程 TimeUnit.SECONDS,// 结束线程时间单位 new LinkedBlockingDeque<>(200), //阻塞队列,限制等候线程数 Executors.defaultThreadFactory(), diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/SandboxRun.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/SandboxRun.java index a762934c..6b09c105 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/SandboxRun.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/judge/SandboxRun.java @@ -68,7 +68,7 @@ public class SandboxRun { public static final HashMap RESULT_MAP_STATUS = new HashMap<>(); - private static final int maxProcessNumber = 32; + private static final int maxProcessNumber = 128; private static final int TIME_LIMIT_MS = 16000; diff --git a/hoj-springboot/JudgeServer/src/main/resources/application.yml b/hoj-springboot/JudgeServer/src/main/resources/application.yml index bcf31755..864f4ac5 100644 --- a/hoj-springboot/JudgeServer/src/main/resources/application.yml +++ b/hoj-springboot/JudgeServer/src/main/resources/application.yml @@ -39,7 +39,7 @@ logging: alibaba: nacos: error gargoylesoftware: off - root: info + root: error config: classpath:logback-spring.xml file: path: /judge/log/judgeserver