On Fri, Jul 11, 2014 at 2:11 PM, Pete <[email protected]> wrote:
> When I checked the "Instances" page on the App Engine dashboard, it showed > the resident instance as well as a dynamic instance, but all the requests > were going through the dynamic instance. Once I shutdown the dynamic > instance, all new requests went through the resident instance, as I > expected. BUT, when someone accessed the site after 15 minutes of > inactivity (the time it takes for a dynamic instance to shutdown and need > to be restarted), the next request went through a new dynamic instance > which was spun up, again taking 4-5 seconds, instead of using the resident > instance which was already running. > I tend to think that this isn't what's supposed to happen. Is there > something that I'm doing incorrectly? I really appreciate the help. > No, you're seeing the correct behavior. Dynamic instances are intended to carry the majority of the traffic load, while resident instances are intended to carry spike traffic (handle requests while dynamic instances spool up). Of course, occasionally you'll see a request wait for a dynamic instance to open (it's called a loading request, and you'll see an entry in your logs when that happens) even when a resident instance is doing nothing - that happens when the scheduler believes there's enough traffic to warrant opening a dynamic. The major problem here, IMO, is that your traffic level is too low and isn't giving the scheduler enough data to properly allocate instances. What I would do is configure a cron job to periodically hit your application <https://developers.google.com/appengine/docs/python/config/cron> and execute some fake load/activity. For instance, configure a cron to execute a script every 5 minutes and have the script sleep for 15 seconds <https://docs.python.org/2/library/time.html#time.sleep> and print out some text into logging. If your app needs a periodic cleanup task handled, you can insert that into this script as well. ----------------- -Vinny P Technology & Media Consultant Chicago, IL App Engine Code Samples: http://www.learntogoogleit.com -- You received this message because you are subscribed to the Google Groups "Google App Engine" 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/google-appengine. For more options, visit https://groups.google.com/d/optout.
