He could also pre-load only specific products, say, the most used up to a 
limit, say, the 10k most used,
again, pre-loading is not a bad concept, sometimes is a requirement so my 
point was only to show a way to do that.

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 <oxy...@gmail.com 
> <javascript:>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to