Ikai, Yes you are right the expensive part is initializing the EntityManagerFactory in my case. Is there any way we can improve the performance on that.
Thanks, Rahul ---------------------------------------------------------- Rahul Juneja http://techlabs.thoughtclicks.com On Wed, Jun 2, 2010 at 12:55 PM, Ikai L (Google) <[email protected]> wrote: > There's very little cost to "connecting" to the datastore. If this is an > issue, I'd look at the low-level API for anything that could be a warm-up > request. The expensive part of this is initializing your > PersistenceManagerFactory/EntityManagerFactory, not establishing a datastore > connection. > > On Tue, Jun 1, 2010 at 8:12 PM, Rahul Juneja <[email protected]>wrote: > >> Ikai, >> The problem is that i am not sure when the values in the cache will be >> accessed. but anyways i have implemented it in such a way that if the value >> is not found in cache it goes to database to fetch it, but another issue >> there is that if you are making the database connection first time after the >> new jvm instance has been kicked off as it happens in Appengine, db >> connection takes a while, sometimes around 6-7 seconds, which is kind of >> slow. >> >> Nicolas, >> Thats the reason i am fetching the data if not found in cache. >> >> >> Thanks, >> Rahul >> >> ---------------------------------------------------------- >> Rahul Juneja >> http://techlabs.thoughtclicks.com >> >> >> On Tue, Jun 1, 2010 at 9:41 PM, Ikai L (Google) <[email protected]>wrote: >> >>> The items will get flushed if they are not getting used. If you're using >>> items once every 24 hours ... you probably do not need a cache. Use the >>> datastore instead. Rather than prevent the items from being flushed, build >>> the ability to regenerate the cache into your system or don't even bother >>> with Memcache. >>> >>> On Tue, Jun 1, 2010 at 6:24 PM, Rahul Juneja <[email protected]>wrote: >>> >>>> Ikai, >>>> >>>> I think you are right that the cache values are expiring via LRU as >>>> sometimes only some elements of the cache are flushed. >>>> But the question is my cache only has 20-30 entries and out of that 10 >>>> least recently used entries are being flushed. Is there any way i can >>>> prevent this flushing as i don't want to flush if the cache is so small >>>> instead i want the cache only to flush LRU elements when the cache grows in >>>> size to maybe 100,000 entries. >>>> >>>> Any clues ? >>>> >>>> Thanks, >>>> Rahul >>>> >>>> ---------------------------------------------------------- >>>> Rahul Juneja >>>> http://techlabs.thoughtclicks.com >>>> >>>> >>>> On Tue, Jun 1, 2010 at 6:56 PM, Ikai L (Google) <[email protected]>wrote: >>>> >>>>> No, there isn't a default expiration. How are you setting values to the >>>>> cache? Could you be expiring the items via LRU? That is - you're not using >>>>> the items in the cache, instead setting other items and pushing the older, >>>>> unused items out? >>>>> >>>>> On Wed, May 26, 2010 at 6:43 PM, Rahul <[email protected]> wrote: >>>>> >>>>>> I have a memcache and not to mention it does live between different >>>>>> jvm instances when new jvm instances starts, i can access the cache >>>>>> but once a while i don't find any values in cache and this happened >>>>>> twice in last 24 hours. Is there any default expiration which is less >>>>>> then 24-48 hours which i am not aware of. >>>>>> >>>>>> Any help or pointers on this is appreciated. >>>>>> >>>>>> Thanks, >>>>>> Rahul >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Google App Engine for Java" group. >>>>>> To post to this group, send email to >>>>>> [email protected]. >>>>>> To unsubscribe from this group, send email to >>>>>> [email protected]<google-appengine-java%[email protected]> >>>>>> . >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/google-appengine-java?hl=en. >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Ikai Lan >>>>> Developer Programs Engineer, Google App Engine >>>>> Blog: http://googleappengine.blogspot.com >>>>> Twitter: http://twitter.com/app_engine >>>>> Reddit: http://www.reddit.com/r/appengine >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Google App Engine for Java" group. >>>>> To post to this group, send email to >>>>> [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]<google-appengine-java%[email protected]> >>>>> . >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/google-appengine-java?hl=en. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Google App Engine for Java" group. >>>> To post to this group, send email to >>>> [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<google-appengine-java%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/google-appengine-java?hl=en. >>>> >>> >>> >>> >>> -- >>> Ikai Lan >>> Developer Programs Engineer, Google App Engine >>> Blog: http://googleappengine.blogspot.com >>> Twitter: http://twitter.com/app_engine >>> Reddit: http://www.reddit.com/r/appengine >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Google App Engine for Java" group. >>> To post to this group, send email to >>> [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<google-appengine-java%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/google-appengine-java?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine for Java" group. >> To post to this group, send email to >> [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-appengine-java%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-appengine-java?hl=en. >> > > > > -- > Ikai Lan > Developer Programs Engineer, Google App Engine > Blog: http://googleappengine.blogspot.com > Twitter: http://twitter.com/app_engine > Reddit: http://www.reddit.com/r/appengine > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
