Skip to content

Commit

Permalink
Reduce the number of vert.x eventloops started by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Jul 29, 2022
1 parent 8f171cd commit 4cb0eec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ private static int calculateDefaultIOThreads() {
//it's hard to say what this number should be, but it is also obvious
//that for constrained environments we don't want a lot of event loops
//lets start with 10mb and adjust as needed
int recommended = ProcessorInfo.availableProcessors() * 2;
//We used to recommend a default of twice the number of cores,
//but more recent developments seem to suggest matching the number of cores 1:1
//being a more reasonable default. It also saves memory.
int recommended = ProcessorInfo.availableProcessors();
long mem = Runtime.getRuntime().maxMemory();
long memInMb = mem / (1024 * 1024);
long maxAllowed = memInMb / 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class VertxConfiguration {
public boolean classpathResolving;

/**
* The number of event loops. 2 x the number of core by default.
* The number of event loops. By default, it matches the number of CPUs detected on the system.
*/
@ConfigItem
public OptionalInt eventLoopsPoolSize;
Expand Down

0 comments on commit 4cb0eec

Please sign in to comment.