high cpu on akka.io.pinned-dispatcher

382 views
Skip to first unread message

Jim Newsham

unread,
Mar 2, 2015, 8:31:10 PM3/2/15
to spray...@googlegroups.com

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

Jim Hazen

unread,
Mar 3, 2015, 2:37:23 AM3/3/15
to spray...@googlegroups.com

Jim Newsham

unread,
Mar 3, 2015, 3:11:07 PM3/3/15
to spray...@googlegroups.com

Yes, I was testing on Windows, and yes, setting windows-connection-abort-workaround-enabled to off fixed the high cpu issue.  Thanks so much for the pointer.  

So, if I understand correctly, disabling this workaround means that akka io is not able to detect when the remote side has aborted the connection.  What's the drawback of disabling this workaround?  Would this be bad?

Thanks,
Jim

Jim Newsham

unread,
Mar 3, 2015, 6:44:40 PM3/3/15
to spray...@googlegroups.com

My question was answered here:  https://groups.google.com/forum/#!msg/akka-user/NVU6pp5iYGE/O_fCZUt2IpEJ.  To quote: "In short when you set it to off on windows, and a client aborts the server might in some cases not notice that the connection is closed until it tries to write to it.".

Thanks,
Jim
Reply all
Reply to author
Forward
0 new messages