On Thu, Feb 19, 2015 at 8:00 AM, Syed Rizvi <ammari...@gmail.com> wrote:

> I have a RESTful service that gets XML data from an external URL, does
> some work on it and serves it to its clients. The dataset is initialized in
> the init() method and takes > 1 minutes but less than 2 to be initialized
> and is naturally supposed to be there before the first client request comes
> in. This works on the local machine properly, but not when deployed to GAE.
> What exactly am I missing? What would be the right way to do it? Here's
> what the log says:
>
> javax.servlet.ServletContext log: unavailable
> com.google.apphosting.api.DeadlineExceededException: This request
> (4865075fa7d7c4db) started at 2015/02/19 13:38:24.019 UTC and was still
> executing at 2015/02/19 13:39:23.816 UTC.
>


Can you look in your logs and see if there are any requests to the path
_ah/startup? If so, can you post what their HTTP status code response is
(202, 500, 404, etc)? Also, are you getting DeadlineExceededException on
every instance startup (meaning that your app can't run at all on
production App Engine) or only intermittently?

Just because you have warmup requests enabled doesn't necessarily mean all
requests will be handed off to a warm instance. Yes, many requests will be
handled by warm instances, but traffic can still be handed off to
cold-started instances in certain situations. Those cold-started instances are
still subject to a 60-second deadline to start up
<https://cloud.google.com/appengine/articles/deadlineexceedederrors>. Your
log sample seems to be from a cold-start instance.

There are several ways of handling this. If you want to try solving it
through raw processing power, you can increase the number of idle instances
<https://cloud.google.com/appengine/docs/adminconsole/performancesettings>
or increase the size of your instances (for example, going from an F1 to F2)
<https://cloud.google.com/appengine/docs/python/modules/#instance_classes>.
Another way is to move the dataset initialization logic somewhere else; for
instance you could move it out of init and into a request handler, then hit
that handler with a cron request on a regular basis
<https://cloud.google.com/appengine/docs/java/config/cron> and cache the
information in memcache/datastore/cloud storage.


-----------------
-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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CALSvALAc4oe5XtRwuHcdf_qozfR49-wWd%2B9CL-_XF7SfA9n_xA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to