Hello, I am running into some OOM errors with too many threads being created, I was hoping to get some help on ideas of where to look. This is my first project with scala and akka. It is a cache module that talks to redis. Here is the overview:
- Java classes call into the library which is scala. - Main scala cache class returns a scala.concurrent.Future wrapped in a RXJava Observable - There is one actor per redis client, it holds a persistent connection to the server. Using scredis which uses akka-io. - Scala cache class uses Patterns.ask() to interact w/ the Actors. It sends a msg to PoolingActor that does consistent hashing and forwards the msg to the appropriate RedisActor. - The RedisActor uses futures from the actual scredis client and 'tells' the response to the ScalaCache class sender. An explicit ExecutionContext is used on the future here. - The ScalaCache class does a .flatMap on the future to clean up the data returned and that was returned to the caller. Scredis uses 2 PinnedDispatchers. I have tried using the a dispatcher per actor and just the global. This works under normal load and looks to take about 1-3ms. As I start increasing the requests 30 tps, I see all these extra ThreadPools show up "pool-XXX-thread-XX". And it blows up at 2030 threads on my Mac. Through debugging it seems the ThreadPools are coming from Promise objects that are created for the ask, tell, and flatMap. They stand out as they are not named. There doesn't seem to be a way to prevent the extra ThreadPools to be created for the ask, tell, and flatMap or is there? Am I barking up the wrong tree? I am thinking I have something wrong as I can't find mention of this type of problem. I am considering trying a TypedActor instead of Patterns.ask as well. Any suggestions would be helpful!! -al -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
