Last Updated: February 25, 2016
·
1.018K
· akbertram

Nevermind, I love AppEngine request time limits

I've been running apps on Google AppEngine for almost three years now, and up to this point, the 30 second request time limit has an occasional annoyance, a "limitation" of the GAE platform to be dealt with from time to time.

Migrating activityinfo.org from Amazon Beanstalk to AppEngine, I get it: it's a feature!

Finally, with easy per-request logging and metrics on AppEngine, it's become clear that there were a few monster queries that were seriously sabotaging the app as the number of concurrent users exploded.

One handler was relying on Hibernate to get the list of sites that had been updated since last sync, which can be in the thousands, and Hibernate was happily issuing a query to fetch a related entity FOR EACH ROW-- resulting in thousands of roundtrips to the database server. Easily fixed, but also easy to miss when the server hasn't got much else to do.

On Beanstalk, these sub-optimal queries happily chug along, hammering the database server and monopolizing scarce threads on the app server, effectively shouldering everybody else out.

On AppEngine, these cancerous queries get shutdown after 30 seconds, the error is logged, and we catch the problem during initial tests, not when 50 people are setting around in training waiting for the server to come up for air.