Warming Up Building an endpoint of warmup, You can prepare before serving data for user’s request. For example, you retrieve the data from datastore and store it on memcache to respond faster.
Shortest Route 1. No custom domain If you send an internal request to a different service, you should not use custom domain to decrease name resolution cost.
Shortest Route 2. Turn off FollowRedirects Internal API should not return other than 200, 400, and 500 series statues. And you should exclude redirects with setting FollowRedirects to false.
Shortest Route 3. Single Project Networking between multi-projects will add latency, so if you purpose the best performance, merge services into one project.
Delayed Job delay package is also background job handling system. It depends on Task Queue. It simplify the asynchronous API of Task Queue, and it can receive arguments of struct.
Delayed Job delay package is also background job handling system. It depends on Task Queue. It simplify the asynchronous API of Task Queue, and it can receive arguments of struct. default Task Queue runs tasks through HTTP request and can pass only a string query parameter.
*Caution delay.Func will search an execution target with file name and task key, so if you change the file name, waiting tasks will drop because it can’t find the func. Additionally, it must be declared on init() or as a global variable. If it was declared inside of request handling, a receiver instance may fail because Func wasn’t initialized just after spinning-up.
Batching Executing Get/Put/Delete for multi resources in the loop will generate RPC calls. If you can get keys for the records, reduce them with GetMulti/PutMulti/DeleteMulti. And Task Queue also supports AddMulti for bulk insertion.
Caching Storing/Fetching data from Memcache is better for performance. The cache will be shared among instances. Some third-party packages are good for using Datastore and Memcache simultaneously. • mjibson/goon • mercari/datastore
Asynchronous requests with goroutine AppEngine environment forces GOMAXPROCS=1. But within I/O wait time, Go will schedule to other goroutine. Like Datastore/Search API call can be artificially asynchronous and it performs excellent latency.
Asynchronous requests with goroutine Basically GetMulti/PutMulti is effective. But when you cannot know the datastore.Key before fetching. For example, goroutine is better for query filtering.
4VNNBSZ • AppEngine is tunable with routing, background job, goroutine, batch, cache, etc… • Async func is really attractive if your primary goal is performance. However, you must take care of error handling and initialization.