Tuning for Throughput
Let us assume that we have a throughput goal to process 13,000,000 jobs/hour. The example configurations used again give us a configuration where the requirement is fulfilled:
|Heap||GC Algorithm||Useful work||Longest pause|
Running this configuration as:
java -Xmx12g -XX:+UseParallelGC Producer
we can see that the CPUs are blocked by GC for 8.5% of the time, leaving 91.5% of the computing power for useful work. For simplicity’s sake we will ignore other safe points in the example. Now we have to take into account that:
- One job is processed in 100 ms by a single core
- Thus, in one minute, 60,000 jobs could be processed by one core
- In one hour, a single core could thus process 3.6 M jobs
- We have four cores available, which could thus process 4 x 3.6 M = 14.4 M jobs in an hour
With this amount of theoretical processing power we can make a simple calculation and conclude that during one hour we can in reality process 91.5% of the 14.4 M theoretical maximum resulting in 13,176,000 processed jobs/hour, fulfilling our requirement.
It is important to note that if we simultaneously needed to fulfill the latency requirements set in the previous section, we would be in trouble, as the worst-case latency for this case is close to two times of the previous configuration. This time the longest GC pause on record was blocking the application threads for 1,104 ms.