Hello,
Having multiple connections in a pool serves two basic purposes:
1) it provides the ability to
submit multiple JPPF jobs concurrently from the same JPPFClient. In this scenario, the number of connections represents the maximum number of jobs that can be sent concurrently to the server. See demos
here and
here.
2) it also enables sending a single job over multiple connections in parallel, the goal being to provide parallel I/O speedup for large jobs. To accomplish this, you need to set up proper load-balancing parameters in the client configuration (different from the default which are desgined to send all tasks of a job through the same connection) and specify the number of connections in the job SLA.
Example load-balancing setup:
# default is "manual" with size = 1,000,000
jppf.load.balancing.algorithm = proportional
jppf.load.balancing.profile = proportional
# "proportional" profile
jppf.load.balancing.profile.proportional.performanceCacheSize = 1000
jppf.load.balancing.profile.proportional.proportionalityFactor = 1
jppf.load.balancing.profile.proportional.initialSize = 10
jppf.load.balancing.profile.proportional.initialMeanTime = 3e10
The code to submit a job over 2 connections in parallel would be like this:
JPPFClient client = ...;
JPPFJob job = ...;
// use up to 2 connections to submit the job
job.getClientSLA().setMaxChannels(2);
client.submitJob(job);
Note that 1) and 2) can be used together in any combination you choose.
Knowing this, I would say that most of the time a single connection will be enough. Using multiple connections will be useful in scenarios where you have multiple jobs to execute concurrently from the same client, or if you have jobs with very large memory footprints, which would benefit from parallel I/O.