You are correct. I am not using a web browser but a .net class
(HttpWebRequest) that was performing the same function that you described.

For those that are keeping score you just need to set the "ConnectionLimit"
property on HttpWebRequest's service point to a value other than two.

Thanks for the response
Mark


-----Original Message-----
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Monday, July 15, 2013 3:39 PM
To: Tomcat Users List
Subject: Re: Tomcat Concurrency

2013/7/16 Mark Haroldson <markharold...@msn.com>:
> Hello;
>
>
>
> I am running a tomcat 6 webapp using Jersey and I am running into a 
> concurrency issue. When there are multiple concurrent connections to 
> tomcat only one or two are processed concurrently. I have increased 
> the maxThreads on the connector and now can see the requests being 
> processed  by different threads however I still on observe one or two
threads running concurrently.
>
>
>
> Example:
>
> Given the following servlet;
>
>
>
> Servlet()
>
> {
>
> Output("Start thread");
>
> Thread.sleep(20000);
>
> Output("End thread")
>
> }
>
>
>
> I would expect the following output
>
>
>
> Start Thread
>
> Start Thread
>
> Start Thread
>
> Start Thread
>
> End Thread
>
> End Thread
>
> End Thread
>
> End Thread
>
>
>
> Instead I see
>
> Start Thread
>
> Start Thread
>
> End Thread
>
> End Thread
>
> Start Thread
>
> End Thread
>
> Start Thread
>
> End Thread
>
>
>
> What are the factors that control thread concurrency in Tomcat? Has 
> anyone seen behavior like this before? Should I expect a high number 
> of concurrent threads or does java/tomcat gate access to the servlet?
>

Looking at a crystal ball I would guess that your client is a web browser. A
well-behaving browser creates no more than 2 simultaneous connections to the
same host (a limitation recommended by the HTTP specification).

A Tomcat can certainly serve more than 2 clients simultaneously. It is
possible to mis-configure it or create a servlet that serves no more than 1
client, but you must be creative (in a newbie way) to do so.

Without seeing your actual configuration and your actual code it is
impossible to provide any review.

If congestion were at Tomcat side, as when several threads are waiting for
the same resource, it would be easy to spot the place by taking a pair of
thread dumps (see wiki -> FAQ -> Troubleshooting).


Best regards,
Konstantin Kolinko

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



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

Reply via email to