What is a "reasonable number of actors" ? (Or should I go read something else?)

261 views
Skip to first unread message

David Walend

unread,
Aug 31, 2017, 12:51:36 PM8/31/17
to spray.io User List
I was having some trouble with throughput on a spray service that's been getting more and more complex operations. 

I tried using detach() and blocking{} for anything that was doodling with IO or decrypting thing, but it didn't seem to help. I'm pretty sure I found them all, and have a very basic case that behaves single-threaded.

I found https://stackoverflow.com/questions/32151859/configuring-spray-servlet-to-avoid-request-bottleneck , which helped a lot, but led to the question: What is a reasonable number of actors? My first dumb guess is the same number as the default thread pool.

But I don't quite understand why I need to care, and why detach() didn't help free up that single actor. The doc for detach() and also https://stackoverflow.com/questions/31364405/sprays-detach-directive I think say that detach() should do fine.

(That last stack overflow says it shouldn't matter when we switch to akka-http in a few months.)

Thanks,

David

Age Mooij

unread,
Aug 31, 2017, 1:46:42 PM8/31/17
to spray.io User List
Hi David

As Johannes said on that last SO answer, using the FutureDirectives for doing heavy processing stuff is the best solution to prevent from hogging the routing thread in Spray. Without seeing your code and knowing more about the specific performance behavior of your code under load, I can't really say anything else.

I would strongly recommend you upgrade to akka-http 10.x as soon as possible. The migration path is relatively straightforward and the performance benefits are quite large for this kind of usage.

Hope this helps,
Age

--
You received this message because you are subscribed to the Google Groups "spray.io User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
Visit this group at https://groups.google.com/group/spray-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/92fa447b-ab1b-481f-a1f6-b2c8147c5127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Walend

unread,
Sep 1, 2017, 9:34:34 PM9/1/17
to spray.io User List


On Thursday, August 31, 2017 at 1:46:42 PM UTC-4, Age Mooij wrote:

Hope this helps,
Age

Thanks Age. It definitely does. 
Reply all
Reply to author
Forward
0 new messages