Hi,
Recently, I realize such a problem with my Tomcat 6.0:
When two (almost) concurrent requests to the SAME servlet occurs (for example,
I type the same url in two individual browser window), I find that Tomcat seems
not to work on the second request until the first is done.
This is not a problem if the servlet service method is quick-responded or slow
but heavy in computation, (in the latter case, parallelism of handling requests
saves little time, since CPU resource is limited and becomes a main
bottleneck).
However, in my situtaion, my servlet should wait for some other resources to
respond. Those resources are quick-responded, but transimssion of requests to &
responses from those resources cost much time. Therefore, if the servlet could
be run (service method be called) immediately instead of the previous is done,
the total response time could be reduced.
My servlet usually responds in about 15 seconds. My user accepts this amount of
time, but not 60 seconds. When 5 requests almost concurrently occur, currently,
the last response will not be available until 15*5=75 seconds elapses. This is
terrible....
Is there any option in Tomcat so that I can configurate it to call the same
servlet service method (doGet, doPost) simultanously instead of one by one?
Best Regards,
Dikan Xing
PS. I recond and print the time each doGet starts and ends, which reveal to me
that the second request deson't start until the first completes.