Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Try out a QueuedThreadPool to use all cores

  • Loading branch information...
commit 52a48ef9beb8237dcc78c4fb4b8df76a5006bf6c 1 parent 0ed29a8
James Abley authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 ext/jetty/src/main/java/JettyWarMain.java
5 ext/jetty/src/main/java/JettyWarMain.java
View
@@ -1,7 +1,9 @@
+import org.eclipse.jetty.server.AbstractConnector;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.webapp.WebAppContext;
import java.io.File;
@@ -27,8 +29,9 @@ public static void main(String[] args) throws Exception {
webapp.setDefaultsDescriptor(webdefaultPath());
Server server = new Server();
- Connector connector = new SelectChannelConnector();
+ AbstractConnector connector = new SelectChannelConnector();
connector.setPort(Integer.getInteger("jetty.port",8080).intValue());
+ connector.setThreadPool(new QueuedThreadPool(Integer.getInteger("jetty.threadpool.size",Runtime.getRuntime().availableProcessors()+1)));
server.setConnectors(new Connector[]{connector});
server.setHandler(webapp);
server.start();
Please sign in to comment.
Something went wrong with that request. Please try again.