Thread pools in a multithreaded server are programmatically adjusted,
based on observed statistics from the server's inbound workload. In a
multithreaded server environment, response time to end users is improved
while increasing the efficiency of software execution and resource usage.
Execution time and wait/queued time are tracked, for various types of
requests being serviced by a server. Multiple logical pools of threads
are used to service these requests, and inbound requests are directed to
a selected one of these pools such that requests of similar
execution-time requirements are serviced by the threads in that pool. The
number and size of thread pools may be adjusted programmatically, and the
distribution calculation (i.e., determining which inbound requests should
be assigned to which pools) is a programmatic determination. In preferred
embodiments, only one of these variables is adjusted at a time, and the
results are monitored to determine whether the effect was positive or
negative. The disclosed techniques also apply to tracking and classifying
requests by method name (and, optionally, parameters).