tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From otismo <>
Subject Re: nio connector configuration
Date Fri, 27 Feb 2009 19:11:41 GMT

Thanks for the response, Filip.  Hopefully this is more helpful...

I put a war at containing my web app, the
source, and my jmeter test plan.

My question: why are comet timeouts getting generated substantially behind
the timeout setting?

Is it because I have incorrectly configured tomcat?  Is there something
wrong with my test?  Can anyone else confirm this behavior?

It seems as though the normal (non-comet) http requests are taking priority
over the comet requests.

The test is very simple.  One set of threads sends non-comet http requests
every 10 seconds.  Another set of threads sends comet requests with a single
byte in the body.  The comet servlet sets a comet timeout of 10 seconds,
reads the request body, and then closes the connection on receiving the
comet timeout event.  On close of the connection, the comet test threads
then send another comet request.

I have JMeter set to start 100 threads for the http thread group and 100
threads for the comet thread group, ramping up at 1 thread per second.  

A fifteen minute test shows:
http requests: 9750 samples
http response time: avg 109ms, min 66ms, max 3699ms
http errors: 0%
http throughput: 9.5 requests/second
comet requests: 1942 samples
comet response time: avg 50149ms, min 10353ms, max 120876ms (tcp timeout is
set to 120000)
comet errors: 0%
comet throughput: 1.9 requests/second
cpu use is minimal (1-4%)

There are no errors in the catalina log.

I also added timing code to the test servlet to confirm that JMeter's
measurements are accurate and found they are.  After confirming the
measurements, I removed the timing code.

I noticed on even short tests the http requests predominate, even though
there should be roughly the same # of http requests as comet requests (1
request/10 seconds/thread and there are 100 threads for each thread group,
http and comet).

My NIO configuration is:
    <Connector port="80"
	enableLookups="false" />

os: ubuntu 8.10 (although also observed same behavior on Windows XP SP 3)
tomcat 6.0.18

(Note: the following are also in the war bundle referenced at top)
The client TCP request looks like this (without the ####s):
POST /test/cometTest HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2)
Gecko/20081201 Firefox/3.1b2
Connection: keep-alive
Content-Type: text/plain
Content-Length: 1


The http test servlet's doGet method looks like this:
    protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException {

The comet test servlet's event method looks like this:
    public void event(CometEvent event) throws IOException, ServletException
        HttpServletRequest request = event.getHttpServletRequest();
        if (event.getEventType() == CometEvent.EventType.BEGIN) {
        } else if (event.getEventType() == CometEvent.EventType.ERROR) {
        } else if (event.getEventType() == CometEvent.EventType.END) {
        } else if (event.getEventType() == CometEvent.EventType.READ) {
            InputStream is = request.getInputStream();
            byte[] buf = new byte[512];
            do {
            } while (is.available() > 0);

Thanks for any help,
View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message