use of org.eclipse.jetty.server.nio.BlockingChannelConnector in project jena by apache.
the class SPARQLServer method defaultServerConfig.
private static Server defaultServerConfig(int port, boolean loopback) {
// Server, with one NIO-based connector, large input buffer size (for
// long URLs, POSTed forms (queries, updates)).
Server server = new Server();
// Using "= new SelectChannelConnector() ;" on Darwin (OS/X) causes
// problems
// with initialization not seen (thread scheduling?) in Joseki.
// BlockingChannelConnector is better for pumping large responses back
// but there have been observed problems with DirectMemory allocation
// (-XX:MaxDirectMemorySize=1G does not help)
// Connector connector = new SelectChannelConnector() ;
// Connector and specific settings.
BlockingChannelConnector bcConnector = new BlockingChannelConnector();
// bcConnector.setUseDirectBuffers(false) ;
Connector connector = bcConnector;
// Ignore. If set, then if this goes off, it keeps going off
// and you get a lot of log messages.
// Jetty outputs a lot of messages if this
connector.setMaxIdleTime(0);
// goes off.
if (loopback)
connector.setHost("localhost");
connector.setPort(port);
// Some people do try very large operations ...
connector.setRequestHeaderSize(64 * 1024);
connector.setRequestBufferSize(5 * 1024 * 1024);
connector.setResponseBufferSize(5 * 1024 * 1024);
server.addConnector(connector);
return server;
}
Aggregations