@Signature public void minThreads(int minThreads) { threadPool.setMinThreads(minThreads); }
/** * Set the min, max number of worker threads (simultaneous connections). */ public void setThreads(int min, int max) { QueuedThreadPool pool = (QueuedThreadPool) webServer.getThreadPool(); pool.setMinThreads(min); pool.setMaxThreads(max); }
/** * Set the min, max number of worker threads (simultaneous connections). */ public void setThreads(int min, int max) { QueuedThreadPool pool = (QueuedThreadPool) webServer.getThreadPool(); pool.setMinThreads(min); pool.setMaxThreads(max); }
threadPool.setMinThreads(webThreadCount * 2 + 1); threadPool.setMaxThreads(webThreadCount * 2 + 100);
HTTP_MAX_THREADS_KEY_DEFAULT)); QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads); threadPool.setMinThreads(minThreads); httpServer = new Server(threadPool);
threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
if (config.getQueueSize() == Integer.MAX_VALUE) { threadPool = new QueuedThreadPool(); threadPool.setMinThreads(numServerThreads); threadPool.setMaxThreads(numServerThreads); } else {
public void startJettyContainer() throws Exception { jettyServer = new Server(serviceProperties.getServicePort()); org.eclipse.jetty.util.thread.ThreadPool threadPool = jettyServer.getThreadPool(); if (threadPool instanceof QueuedThreadPool) { ((QueuedThreadPool) threadPool).setMaxThreads(FeatureFlags.getMaxJettyThreads(serviceProperties)); ((QueuedThreadPool) threadPool).setMinThreads(FeatureFlags.getMinJettyThreads(serviceProperties)); } else { logger.warn("Expected ThreadPool to be instance of QueuedThreadPool, but was {}", jettyServer.getThreadPool().getClass().getName()); } JettyComposer.compose(jettyServer); jettyServer.start(); int port = ((ServerConnector) jettyServer.getConnectors()[0]).getLocalPort(); logger.info("Jetty has started on port {}", port); serviceProperties.setServicePort(port); }
public QueuedThreadPool(@Name("maxThreads") int maxThreads, @Name("minThreads") int minThreads, @Name("idleTimeout") int idleTimeout, @Name("reservedThreads") int reservedThreads, @Name("queue") BlockingQueue<Runnable> queue, @Name("threadGroup") ThreadGroup threadGroup) { if (maxThreads < minThreads) { throw new IllegalArgumentException("max threads ("+maxThreads+") less than min threads (" +minThreads+")"); } setMinThreads(minThreads); setMaxThreads(maxThreads); setIdleTimeout(idleTimeout); setStopTimeout(5000); setReservedThreads(reservedThreads); if (queue==null) { int capacity=Math.max(_minThreads, 8); queue=new BlockingArrayQueue<>(capacity, capacity); } _jobs=queue; _threadGroup=threadGroup; setThreadPoolBudget(new ThreadPoolBudget(this)); }
threadPool.setMinThreads(10); threadPool.setMaxThreads(500);
private ThreadPool createThreadPool() { QueuedThreadPool pool = new QueuedThreadPool(50); pool.setMinThreads(8); return pool; }
private ThreadPool createThreadPool() { QueuedThreadPool pool = new QueuedThreadPool(50); pool.setMinThreads(8); return pool; }
protected ThreadPool createThreadPool() { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setMinThreads(1); threadPool.setMaxThreads(Math.max(10, Runtime.getRuntime().availableProcessors())); return threadPool; }
protected ThreadPool createThreadPool() { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setMinThreads(1); threadPool.setMaxThreads(Math.max(10, Runtime.getRuntime().availableProcessors())); return threadPool; }
protected ThreadPool createThreadPool() { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setMinThreads(1); threadPool.setMaxThreads(Math.max(10, Runtime.getRuntime().availableProcessors())); return threadPool; }
/** * Set the min, max number of worker threads (simultaneous connections). */ public void setThreads(int min, int max) { QueuedThreadPool pool = (QueuedThreadPool) webServer.getThreadPool(); pool.setMinThreads(min); pool.setMaxThreads(max); }
public QueuedThreadPool(int maxThreads, int minThreads, int idleTimeout) { setMinThreads(minThreads); setMaxThreads(maxThreads); setIdleTimeout(idleTimeout); setStopTimeout(5000); }
@Modified protected void modified(Map<String, Object> parameters) { getConfigParameters(parameters); if (threadPool != null) { threadPool.setMinThreads(minThreadsShared); threadPool.setMaxThreads(maxThreadsShared); threadPool.setIdleTimeout(keepAliveTimeoutShared * 1000); } }
private ThreadPool createThreadPool() { QueuedThreadPool _threadPool = new QueuedThreadPool(); _threadPool.setName(config.getServerName()); _threadPool.setMinThreads(config.getMinThreads()); _threadPool.setMaxThreads(config.getMaxThreads()); return _threadPool; }