Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka - during load testing, forkjoinpool.scan at 20% of cpu time

We're making some good progress in load testing and scaling an akka application but we're seeing scala.concurrent.forkjoin.ForkJoinPool.scan() coming up as the second highest hotspot around 20% of self time in visualvm. The Self time (CPU) column says only a fraction of that (less than 1% of the value of the self time column).

I suspect this means blocking or context switching are potentially problematic but I'm not too sure - can any one give insight? If it's context switching I'm guessing tuning dispatcher throughput to a higher number may net us gains, otherwise if it's caused by blocking we'll need to read through the code some more.

Any insight greatly appreciated.

like image 232
JasonG Avatar asked Oct 02 '13 21:10

JasonG


1 Answers

The scan method is also where inactive threads in the ForkJoinPool "parks" when they can't find work.

Having 20% self time and 1% of that as self CPU time makes me think that you have inactive threads in the ForkJoinPool that have parked in there.

I'm assuming that you are using VisualVM in Sampling mode. By default VisualVM filters out things in the standard library. See this answer how to change the settings and get a better picture of what's going on. https://stackoverflow.com/a/16113781/1688542

like image 129
Björn Antonsson Avatar answered Oct 20 '22 09:10

Björn Antonsson