On Wed, Jan 30, 2019 at 8:59 PM Scott Gray <scott.g...@hotwaxsystems.com>

> [...]

2. The advice on the number of threads to use doesn't seem good to me, it
> assumes your jobs are CPU bound when in my experience they are more likely
> to be I/O bound while making db or external API calls, sending emails etc.
> [...]

I totally agree with your point above.
Actually the formula that is referenced in the comment, that is derived
from the excellent book "Java Concurrency In Action", is valid but we are
not parametrizing it properly for the typical OFBiz applications because we
are assuming that the "wait time" to "compute time" ratio is rather small
(25%); however in OFBiz applications wait time is heavily affected by I/O
operations for database access and we could set a ratio of 100 or more. In
fact the upper limit we could consider is the maximum number of database
connections in the pool (that in ootb configuration files is set to 250):
250 threads using 1 connection each (more threads than the amount of
connections may not be used and would wait for a connection to be released).


Reply via email to