Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppEngine performance tuning with idle instances and pending latency settings

I have an app-engine (paid) app that's averaging around 200 visits per day (1000 page views, sporadically it spikes up to 1000 visits and 10000 page views or more) and I am currently waking it up via cron jobs every 5 minutes to ensure reasonable performance. This doesn't always work during app-engine latency spikes (fortunately this does not happen too often as of lately), and when that happens my ajax calls miserably time-out. Also the cron-job strategy is not ideal because it eats away at the quotas.

At the moment I have Idle Instances and Pending Latency settings all on "Automatic".

Does anyone have experience with manually tweaking those settings and what are some typical values that could guarantee better performance on my app given the traffic?

like image 954
JohnIdol Avatar asked Nov 03 '22 18:11

JohnIdol


1 Answers

Instead of cron job, just set Idle Instances to 1. Idle Instances are instances that are in "reserve", giving you instant response to increased load. So if you have a load that requires three instances and you set Idle Instance to one, then you will have 4 instances running.

The downside is that you'll always be paying for one more instance than currently utilised. However, keep in mind you get 28 free instance hours a day, covering one Idle Instance for free ( except for times when you have one instance actually serving requests, then one more Idle instance will be an additional cost).

Also, if you have Idle Instances set, then Pending Latency will have little or no effect, since Pending Latency is consulted when new instances need to be started, but you always have one instance in reserve. Caveat: this my not be true if app code goes haywire or is poorly written (like calling external services inside a request handler), resulting in abnormally long response times.

Bottom line: set Idle Instances to 1, then set Pending Latency to some max value that is still acceptable by your app.

like image 107
Peter Knego Avatar answered Nov 11 '22 03:11

Peter Knego