Skip to content

Commit 907a178

Browse files
align default io/worker threads number
1 parent d25b50e commit 907a178

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

jooby/src/main/java/io/jooby/ServerOptions.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class ServerOptions {
5656
* Default application secures port <code>8443</code> or the value of system property <code>
5757
* server.securePort</code>.
5858
*/
59-
public static final int SEVER_SECURE_PORT =
59+
public static final int SERVER_SECURE_PORT =
6060
Integer.parseInt(System.getProperty("server.securePort", "8443"));
6161

6262
/** Default compression level for gzip. */
@@ -80,19 +80,20 @@ public class ServerOptions {
8080
public static final int IO_THREADS =
8181
Integer.parseInt(
8282
System.getProperty(
83-
"__server_.ioThreads", Integer.toString(Runtime.getRuntime().availableProcessors())));
83+
"__server_.ioThreads",
84+
Integer.toString(Runtime.getRuntime().availableProcessors() * 2)));
8485

8586
private static final String SERVER_NAME = System.getProperty("__server_.name");
8687

8788
/**
88-
* Number of worker (a.k.a application) threads. It is the number of processors multiply by <code>
89+
* Number of worker (a.k.a application) threads. It is the number of ioThreads multiply by <code>
8990
* 8</code>.
9091
*/
9192
public static final int WORKER_THREADS =
9293
Integer.parseInt(
9394
System.getProperty(
9495
"__server_.workerThreads",
95-
Integer.toString(Runtime.getRuntime().availableProcessors() * 8)));
96+
Integer.toString(IO_THREADS * 8)));
9697

9798
/** HTTP port. Default is <code>8080</code> or <code>0</code> for random port. */
9899
private int port = SERVER_PORT;
@@ -564,7 +565,7 @@ public ServerOptions setExpectContinue(@Nullable Boolean expectContinue) {
564565
*/
565566
public @Nullable SSLContext getSSLContext(@NonNull ClassLoader loader) {
566567
if (isSSLEnabled()) {
567-
setSecurePort(Optional.ofNullable(securePort).orElse(SEVER_SECURE_PORT));
568+
setSecurePort(Optional.ofNullable(securePort).orElse(SERVER_SECURE_PORT));
568569
SslOptions options = Optional.ofNullable(ssl).orElseGet(SslOptions::selfSigned);
569570
setSsl(options);
570571

0 commit comments

Comments
 (0)