I have a test code with parallelStream()
that sends requests to a server machine.
Report report =
requestsList.parallelStream()
.map(request -> freshResultsGenerator.getResponse(request, e2EResultLongBL))
.map(response -> resultsComparer.compareToBl(response, e2EResultLongBL,
astarHistogramsArrayBl, latencyHistogramBl))
.reduce(null,
(sumReport, compare2) ->
{
if (sumReport == null) {
sumReport = new Report();
}
sumReport.add(compare2);
return sumReport;
},
(report1, report2) ->
{
Report report3 = new Report();
report3.add(report1);
report3.add(report2);
return report3;
});
The loads are too much for this machine and very quickly it returns HTTP 404 errors.
There are two things I didn't find an answer on Google:
- What is the default # of threads for parallelStream, if not customed set?
- How can I set the number of worker threads to, say, 4?