While looking at my app performance, I noticed a lot of cpu being used by akka.io.pinned-dispatcher. I took my own code out of the equation by simply running the spray-routing "minimal example" (as shown here:
http://spray.io/documentation/1.2.2/spray-routing/), and observed the same results. Specifically, what I observe is that after starting the sample app, and before hitting the server, the cpu is around 0%. Once I hit the server, the cpu jumps up to about 16% on a 6-core machine, so it seems like a single thread is pegged 100%. It stays at this state for 2 minutes, and then returns to 0%.
Is this expected? Could someone explain this to me? If I had to guess, I would say it's related to the asynchronous nature of the I/O which requires polling. Also, why is the thread only pegged for 2 minutes, instead of all of the time? Does spray switch to using a blocking strategy after the app quiets down?
Thanks,
Jim