Increase thread pool timeout to try and reduce churn
This commit is contained in:
parent
3132d2c7cf
commit
09d04c34cb
@ -78,8 +78,7 @@ public class BungeeCord extends ProxyServer
|
|||||||
/**
|
/**
|
||||||
* Thread pools.
|
* Thread pools.
|
||||||
*/
|
*/
|
||||||
public final ScheduledThreadPoolExecutor executors = new BungeeThreadPool( Integer.MAX_VALUE,
|
public final ScheduledThreadPoolExecutor executors = new BungeeThreadPool( new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
|
||||||
new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
|
|
||||||
public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
|
public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
|
||||||
/**
|
/**
|
||||||
* locations.yml save thread.
|
* locations.yml save thread.
|
||||||
@ -190,9 +189,6 @@ public class BungeeCord extends ProxyServer
|
|||||||
@Override
|
@Override
|
||||||
public void start() throws Exception
|
public void start() throws Exception
|
||||||
{
|
{
|
||||||
executors.setKeepAliveTime( 60, TimeUnit.SECONDS );
|
|
||||||
executors.allowCoreThreadTimeOut( true );
|
|
||||||
|
|
||||||
pluginsFolder.mkdir();
|
pluginsFolder.mkdir();
|
||||||
pluginManager.loadPlugins( pluginsFolder );
|
pluginManager.loadPlugins( pluginsFolder );
|
||||||
config.load();
|
config.load();
|
||||||
|
@ -2,15 +2,18 @@ package net.md_5.bungee.scheduler;
|
|||||||
|
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
|
||||||
public class BungeeThreadPool extends ScheduledThreadPoolExecutor
|
public class BungeeThreadPool extends ScheduledThreadPoolExecutor
|
||||||
{
|
{
|
||||||
|
|
||||||
public BungeeThreadPool(int corePoolSize, ThreadFactory threadFactory)
|
public BungeeThreadPool(ThreadFactory threadFactory)
|
||||||
{
|
{
|
||||||
super( corePoolSize, threadFactory );
|
super( Integer.MAX_VALUE, threadFactory );
|
||||||
|
setKeepAliveTime( 5, TimeUnit.MINUTES );
|
||||||
|
allowCoreThreadTimeOut( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user