Search code examples
springhibernategoogle-app-enginescalabilitygoogle-cloud-sql

About App Engine scalability and the 60 seconds timeout


I have an app-engine+spring+hibernate mobile/web backend configured with F2 instances and D2 cloud sql instance. I've also configure warm-ups by configuring Idle Instances to be minimum 1. I have two questions:

  1. Is it possible to configure cloud sql instances to scale up when needed?
  2. My app takes about 20-40 seconds to start (after removing autowiring and doing all the optimization tips described here: https://developers.google.com/appengine/articles/spring_optimization). Still I get slow latency (~20-40 seconds) for some of the requests during load testing. I believe this is because app engine starts new instances and it takes them this much time to start. After the instances are up and running, everything is working fine, until too many users connect and again the delay. Is there a way I can solve this other then configuring more minimum live instances?

Solution

  • As Tony said, you can't configure Cloud SQL to automatically scale according to demand. You could, of course, configure it to serve a higher expected demand from the beginning.

    On the side, I'd like to suggest different things you could do with your app servers:

    1. Change from F2 to F4 or F4_1G (if you're using a lot of memory) to see if that reduces your startup time.
    2. If you're not doing it yet, you could use AppStats [1] to get a better understanding of which are the bottlenecks of your app. If it's only the startup time, and (1) doesn't help, I'm sorry that configure more idle servers would be the answer you're looking for.

    [1] https://developers.google.com/appengine/docs/java/tools/appstats