Ulf: Generally, simultaneous accesses to a servlet container will improve throughput (although not single-process performance, obviously).
I did not get this statement. Access to a servlet container is always simultaneous/concurrent, isnt?
However, the question is whether spawning new threads from within processing a request will
boost performance or not?
I *think* it depends on the servlet container configuration also. If the server already has a lot of *active* threads then spawning new threads will probably not improve performance however, if the cpu is under utilized then it will definetly.
Now, the problem is the number of threads running inside tomcat will *probably* be governed by the load on the server and by the number of applications (though i am not sure about this), so how can one optimally configure a thread-pool to really make use of the parallelism in the request processing and thus improve performance?
Without profiling the application it will really be tough to say that whether spawning new threads to make different Database calls will aid performace. It may be that the bottleneck indeed is database but how much will it be improved by processing multiple database calls parallely is something that can only be speculated untill we have profiling results.
Edward,
this article gives some do's and dont's of spawning new threads from servlets.
IMHO, we should move this post to Performance forum.