There's not really a single hard limit to the number of threads - as you add more threads, the system will gradually slow down - each
thread will accomplish less. Eventually you reach a point of diminishing returns, were the work lost due to slowdown is greater than the work gained by the added threads. The optimum number for performance is best determined by
testing your particular application on machines similar to what your application's users will be using. It may also be useful to make maxThreads a user-configurable parameter, since a user with a 900 MHz chip and 256 MB RAM will probably be able to run a lot more threads than one with 233 MHz and 64 MB. (Of course, you'll also want to configure the amount of memory available to the JVM in this case - see the
java -mx option.)