Skip to content

Commit

Permalink
feat(cli): increase default thread count
Browse files Browse the repository at this point in the history
relate to kestra-io#4775
  • Loading branch information
tchiotludo committed Sep 2, 2024
1 parent aa0c12b commit 81ff4e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
abstract public class AbstractServerCommand extends AbstractCommand implements ServerCommandInterface {
@CommandLine.Option(names = {"--port"}, description = "the port to bind")
Integer serverPort;

protected static int defaultWorkerThread() {
return Runtime.getRuntime().availableProcessors() * 4;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class StandAloneCommand extends AbstractServerCommand {
private File flowPath;

@CommandLine.Option(names = {"--worker-thread"}, description = "the number of worker threads, defaults to two times the number of available processors. Set it to 0 to avoid starting a worker.")
private int workerThread = Runtime.getRuntime().availableProcessors() * 2;
private int workerThread = defaultWorkerThread();

@CommandLine.Option(names = {"--skip-executions"}, split=",", description = "a list of execution identifiers to skip, separated by a coma; for troubleshooting purpose only")
private List<String> skipExecutions = Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class WorkerCommand extends AbstractServerCommand {
private ApplicationContext applicationContext;

@CommandLine.Option(names = {"-t", "--thread"}, description = "the max number of worker threads, defaults to two times the number of available processors")
private int thread = Runtime.getRuntime().availableProcessors() * 2;
private int thread = defaultWorkerThread();

@CommandLine.Option(names = {"-g", "--worker-group"}, description = "the worker group key, must match the regex [a-zA-Z0-9_-]+ (EE only)")
private String workerGroupKey = null;
Expand Down

0 comments on commit 81ff4e6

Please sign in to comment.