Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26652

How to migrate gae app to new config?

I'm updating my webapp that previously has been using the default configuration. Now I'm starting to use modules trying this config

application: newkoolproject
# Other settings here...
version: newkool
runtime: python27
api_version: 1
threadsafe: true
automatic_scaling:
  min_idle_instances: 5
  max_idle_instances: automatic  # default value
  min_pending_latency: automatic  # default value
  max_pending_latency: 30ms
  max_concurrent_requests: 50

I pay for instance hours, data reads and complex searches totalling a few dollar daily on my current budget (where my limit is 7 USD for a day to avoid sudden spikes due to DoSing or other technical issue).

Could it be feasible for my to try and squeeze my app into the freetier using memcache and other technologies to reduce costs? Or should I forget about reaching free-tier (< 28 instances hours etc) and instead make a configuration for a more optimal UX? How will the change change my costs?

Update 141010 18:59 CET

I could add appstats

enter image description here

Upvotes: 0

Views: 78

Answers (1)

Bardia D.
Bardia D.

Reputation: 693

You'll need to turn appestats on on your local app engine development server, go through your typical user flow. Here are the instructions on how to do this: https://cloud.google.com/appengine/docs/python/tools/appstats

Make sure you turn calculate RPC costs on:

appstats_CALC_RPC_COSTS = True

Once you go through a typical user flow, you would go to localhost:8080/_ah/stats and it will estimate how much specific calls and flows will cost when you get to production. Really great tool, as it even helps identify bottlenecks and slow running areas within your application.

Google's recommendation is to not only use memcache, but also to split work into smaller units (as much as possible) by leveraging task queues.

UPDATE: Simple memcache usage example

my_results = memcache.get("SOME-KEY-FOR-THIS-ITEM")
if not my_results:
  #Do work here
  memcache.set("SOME-KEY-FOR-THIS-ITEM", my_results)

return my_results

Upvotes: 1

Related Questions