I have an actor with many children (about 900 in my current test).
In the course of initializing them, the parent reads some state for each
child from the database, one at a time. I'd love to make these children
PersistentActors, but haven't yet.
I have my DbActor (just one for now) using Slick, assigned to its own
dispatcher.
The DbActor actually lives behind an object implementing a "storage client"
interface which returns Futures and does an ask of the DbActor. I was able
able to eliminate asks in the web tier using the per-request actor pattern.
I'm seeing timeouts logged by the following code:
val processingStateFuture:Future[Option[ProcessingState]] =
storageClient.findProcessingState(id)
val msgFuture: Future[Child.Prepare] = processingStateFuture.map { ps
=> Child.Prepare(ps) }
// Be careful not to close over mutable state.eg, "sender" is mutable
msgFuture.onComplete {
case Success(msg) => child ! msg
case Failure(e) => log.error(s"Failure preparing child $e")
}
Most of the time I use pipeTo, but not in this case.
Wondering if I should make the DbActor a router, or forgo the "storage
client" abstraction and use a tell with the response going to the child. Or
something else entirely.
As an aside, I am able to send a "gather info" message to all 900 children
and produce an HTTP response in a couple of hundred ms. But at 13000
children, that times out at 20s.
Thoughts?
--
>>>>>>>>>> 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.