A Tomcat worker is a Tomcat instance that is waiting to execute servlets on behalf of some web server. For example, we can have a web server such as the Apache HTTP Server forwarding servlet requests to a Tomcat process (the worker) running behind it.
The scenario described above is a very simple one; in fact one can configure multiple Tomcat workers to serve servlets on behalf of a certain web server. The reasons for such configuration can be:
- We want different contexts to be served by different Tomcat workers to provide a development environment where all the developers share the same web server but own a Tomcat worker of their own.
- We want different virtual hosts served by different Tomcat processes to provide a clear separation between sites belonging to different companies.
- We want to provide load balancing, meaning run multiple Tomcat workers each on a machine of its own and distribute the requests between them.
There are probably more reasons for having multiple workers but I guess that this list is enough... Tomcat workers are defined in a properties file dubbed workers.properties and this tutorial explains how to work with it.
This document was originally part of Tomcat: A Minimalistic User's Guide written by Gal Shachor, but has been split off for organisational reasons.