@Signature public void maxThreads(int maxThreads) { threadPool.setMaxThreads(maxThreads); }
/** * 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.setMaxThreads(webThreadCount * 2 + 100);
private static void setupHttpServer(int httpPort, int httpsPort) throws Exception{ QueuedThreadPool pool = new QueuedThreadPool(); pool.setMaxThreads(500); LoklakInstallation.server = new Server(pool); LoklakInstallation.server.setStopAtShutdown(true);
private static void setupHttpServer(int httpPort, int httpsPort) throws Exception{ QueuedThreadPool pool = new QueuedThreadPool(); pool.setMaxThreads(500); pool.start(); LoklakServer.server = new Server(pool);
QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setDaemon(true); threadPool.setMaxThreads(threads); threadPool.setMinThreads(threads);
private void createWebServer(final Builder b) throws IOException { // Create the thread pool for the web server to handle HTTP requests QueuedThreadPool threadPool = new QueuedThreadPool(); if (b.maxThreads > 0) { threadPool.setMaxThreads(b.maxThreads); } threadPool.setDaemon(true); threadPool.setName(b.name + "-web"); this.webServer = new Server(threadPool); this.appDir = getWebAppsPath(b.name); this.webAppContext = createWebAppContext(b); if (b.useSPNEGO) { // Secure the web server with kerberos setupSpnegoFilter(b); } if (b.enableCORS) { setupCORSFilter(b); } initializeWebServer(b, threadPool.getMaxThreads()); }
threadPool.setDaemon(true); if (maxThreads != -1) { threadPool.setMaxThreads(maxThreads);
threadPool = new QueuedThreadPool(); threadPool.setMinThreads(numServerThreads); threadPool.setMaxThreads(numServerThreads); } else { threadPool = new QueuedThreadPool(
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); }
private static void open(int port, String htmlPath) throws IOException { try { QueuedThreadPool pool = new QueuedThreadPool(); pool.setMaxThreads(500); server = new Server(pool);
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.setMaxThreads(500);
/** Construct */ public QueuedThreadPool(int maxThreads) { this(); setMaxThreads(maxThreads); }
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); }