Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] jetty hangs under high load

Hi,
I just wanted to let you know that we can also reproduce

http://jira.codehaus.org/browse/JETTY-1473

We use JMeter to simulate load on our server and Jetty starts to hang when the total throughput is around 100 requests per second with 10, 25 or 50 users.

The thread dump produced when the server is hanging doesn't seem to contain anything useful or obvious: there are no threads waiting for any locks for example.

It makes me think that it could be something in the NIO layer.


We are using Jetty 7.5.4 on Java 1.6.0_29 on Windows 7 SP1 64 bits.


I think this a pretty important bug to fix - please let me know if I can provide any more useful info to fix it.

We use the method below to create our Jetty server.

Many thanks,
Michele



--------------------------

private static Server createJettyServer() {
        Server server = new Server();

        QueuedThreadPool queuedThreadPool = new QueuedThreadPool(256) {
            @Override
            protected Thread newThread(final Runnable runnable) {
                Thread t = new Thread(runnable);
                t.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
                    @Override
                    public void uncaughtException(Thread t, Throwable e) {
                        log.error("Uncaught exception [" + e + "] on thread [" + t + "]", e);
                    }
                });
                return t;
            }
        };
        queuedThreadPool.setDaemon(true);
        queuedThreadPool.setName("my-jetty-pool");
        queuedThreadPool.setMaxStopTimeMs(30000);

        server.setThreadPool(queuedThreadPool);
        server.addLifeCycleListener(new MyAppLifeCycleListener());
        server.setStopAtShutdown(true);
        server.setSendServerVersion(true);
        server.setSendDateHeader(true);
        server.setGracefulShutdown(10000);
        server.setSendDateHeader(false);
        server.setSendServerVersion(false);

        SelectChannelConnector connector = new SelectChannelConnector();
       

        // see http://docs.codehaus.org/display/JETTY/HighLoadServers
        connector.setAcceptQueueSize(2048);
        connector.setMaxIdleTime(240000);
        connector.setPort(containerCfg.port);
        connector.setReuseAddress(false);

        server.addConnector(connector);

        return server;
    }


Back to the top