Configurable Amount of Netty Threads

This brings back the option that the Spigot version of netty saw. By default Netty will try and use cores*2 threads, however if running multiple servers on the same machine, this can be too many threads. Additionally some people have 16 core servers. If 32 Netty threads are allowed in this setup, then the lock contention, and thus blocking between threads becomes much greater, leading to decreased performance.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2013-12-13 11:58:58 +11:00
parent 0abc9c4cd1
commit cbf16b353d
2 changed files with 39 additions and 21 deletions

View File

@@ -224,4 +224,11 @@ public class SpigotConfig
}
SpigotConfig.bungee = SpigotConfig.getBoolean( "settings.bungeecord", false );
}
private static void nettyThreads()
{
int count = SpigotConfig.getInt( "settings.netty-threads", 4 );
System.setProperty( "io.netty.eventLoopThreads", Integer.toString( count ) );
Bukkit.getLogger().log( Level.INFO, "Using {0} threads for Netty based IO", count );
}
}