Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine application instance recycling and response times

I posted this on GAE for Java group, but I hope to get some answers here quicker :)

I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client.

I noticed huge differenced in response times and started to investigate issue. I found reason very quick. I am experiencing same issues as described in following topics:

Uneven response time between connection to server to first byte sent

Application instances seem to be too aggressively recycled

Getting 'Request was aborted after waiting too long to attempt to service your request.' after application idle

I am using Springframework, it tkes around 18-20s to start app instance, which is causing response times to take from 1s (when requests hits running app - very rare) to 22s when fresh application is created.

Is there any solution for this? I was thinking about creating most basic servlet performing critical tasks (serving API call) and leave UI as is. But then I would loose all benefits of Springframework.

Is there any solution for this?

After solving (hacking) numerous constrains of App Engine which I hit while developing my app that is the one I think will make me move out of App Engine... that's simply to much to all the time think how to win with GAE problems than how to solve my application problems...

Any help?

Regards Konrad

like image 414
Konrad Pawlus Avatar asked Jan 12 '10 17:01

Konrad Pawlus


People also ask

What is Google App Engine instance?

The App Engine standard environment is based on container instances running on Google's infrastructure. Containers are preconfigured with one of several available runtimes. The standard environment makes it easy to build and deploy an application that runs reliably even under heavy load and with large amounts of data.

What are the two kinds of instances available in App Engine standard?

There are three scaling types by which Google controls how instances are created. Automatic: Dynamic as per requests. You can specify idle instances. Basic: Dynamic as per requests.

How many types of instances does Google App Engine offer?

Google App Engine provides four possible runtime environments for applications, one for each of four programming languages: Java, Python, PHP, and Go. The environment you choose depends on the language and related technologies you want to use for developing the application.

How does Google App Engine scale?

By default, your app uses automatic scaling, which means App Engine will manage the number of idle instances. Automatic scaling creates instances based on request rate, response latencies, and other application metrics.


1 Answers

I know of some people having a keep-alive thing running in order to have an instance of their app always running. I mean, have a client that sends a request every X seconds so your app doesn't get recycled.

This is a quick thing to implement but seems to go against the spirit of the platform. Make your numbers and check if it is worth it.

Another option would be to refactor your application to make use of more lazy-loading than it does at the moment so it doesn't take that long to kick off.

I don't know if you have any other option apart from these 2.

like image 150
Iker Jimenez Avatar answered Sep 22 '22 10:09

Iker Jimenez