Also, if he is using a KV NoSQL DB like Riak, is extremely fast as it is designed for many KV lookups concurrently, loading 1m objects in a controlled dispatcher might be faster than what you think.
If the requirement is low latency then products needs to be there somehow before 1st query. On Wednesday, December 14, 2016 at 11:36:38 PM UTC, Guido Medina wrote: > > I don't think he has millions of products, the 1m/sec was shown a > theoretical high number otherwise he wouldn't be asking to preload all > products at the beginning. > > On Wednesday, December 14, 2016 at 11:32:46 PM UTC, Justin du coeur wrote: >> >> On Wed, Dec 14, 2016 at 5:53 PM, Guido Medina <[email protected]> wrote: >> >>> *How to pre-load your products and their caches:* >>> >>> Initially you could iterate through your products and send a dummy >>> message to all, say a Boolean.TRUE, >>> a dummy and very small message which will allow you to send up to 1m/sec >>> >>> That way each product will be started before the first query, each >>> product can load its cache, >>> because you have a number of threads operating products don't worry, you >>> won't have more than X loading its cache. >>> >> >> That seems a bit too rosy. For example, say the number of threads >> exceeds the number of DB connections -- you could easily wind up >> bottlenecked on the DB connections. Indeed, depending on your database and >> dispatcher configuration, the whole system could basically grind to a halt >> if things wind up blocking. And you either have to wait until *all* of >> them have finished loading (potentially a long time for a million Products) >> before opening the front door, or the first hit on a given Product could >> take an arbitrarily long time while things are gummed up. >> >> For a small number of objects, sure. But trying to boot a million Actors >> simultaneously, each of them individually doing its own DB operations, >> seems potentially problematic unless handled very carefully... >> > -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
