Hi Mark
maxThreads limits the number of concurrent threads available for
processing requests. "connection" != "concurrent request", primarily
because of HTTP keep-alive.

maxConnections can be used to limit the number of connections.
Thanks for this insight.. I initially missed this when I went through the Tomcat source, but now spent some time trying to understand how it was expected to work
If you set maxConnections to your desired value and repeat your tests
you will hopefully see different results. Depending on exactly how the
load test is designed, acceptCount may still influence the results. I
would be worth experimenting with different values for that as well (I'd
suggest 100, 1 and 0).
However when I tested with this, the same TCP resets were seen under load. After analyzing the source of the NioEndpoint closer I find that it only delays calling "serverSock.accept()" with Thread.sleep()'s - which is not going to help as shown in my first Java example.

            // Loop until we receive a shutdown command
            while (running) {

                // Loop if endpoint is paused
                while (paused && running) {
                    state = AcceptorState.PAUSED;
                    try {
                        Thread.sleep(50);
                    } catch (InterruptedException e) {
                        // Ignore
                    }
                }

                if (!running) {
                    break;
                }
                state = AcceptorState.RUNNING;

                try {
                    //if we have reached max connections, wait
                    countUpOrAwaitConnection();

                    SocketChannel socket = null;
                    try {
// Accept the next incoming connection from the server
                        // socket
                        socket = serverSock.accept();
                    } catch (IOException ioe) {
                        //we didn't get a socket
                        countDownConnection();

regards
asankha


--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to