Configuring Multiple Single-Thread Servlet Containers
Although the servlet container is inherently multithreaded, code that is not multithread-safe can be hosted in a servlet container provided that the container is configured so that only one thread is active within servlet code at a given time, as described above. To increase performance, configure more than one connector/handler chain combination, each of which defines a single-thread servlet container, and use a load balancer to balance requests between them. Although this solution provides somewhat lower performance than a multithreaded servlet container, this strategy may provide acceptable performance for single-threaded code in a production environment.
The only required change to the configuration of the servlets running in the single-thread containers is the attribute
single-thread=”true”. Otherwise, declare servlets as you normally would, as discussed in
Configuring Individual Servlets in the Context-Level web.xml File.