Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what are the cost/perfomance advantages of using "golang" in GAE

In terms of the Quotas/Usage limits per instance, is there any considerable improvement/advantage when using golang in Google appengine GAE instead of other offered language that run within GAE like python, java,php or all of them behave the same?

Or basically any instance no matter the language in use, behave the same way and can handle barely the same amount of maximum requests/sec per instance considering that this concerns more to the "GAE load balancer" or infrastructure, rather than the used programming language, same logic could applied to the memory,cpu usage?

like image 210
nbari Avatar asked Sep 29 '22 21:09

nbari


1 Answers

App Engine doesn't have explicit limits or restrictions that would apply only when using a specific language. However the languages and their technologies might imply certain limitations, for example a Java Virtual Machine instance by itself requires significantly more memory and has significantly higher startup time (even when warmup requests are enabled) than starting the built-in web server of Go, so in case of a Java instance less memory will remain for the webapp itself to allocate and use (for a specific plan/type and instance).

I don't have concrete measures to compare, but (in case of Go):

"Code is deployed in source form and compiled in the cloud... Go is the first true compiled language that runs on App Engine. Go on App Engine makes it possible to deploy efficient, CPU-intensive web applications". (source)

If you think about it, other languages at App Engine are all interpreted (including Java which is byte code interpreted by a Virtual Machine) while Go is compiled into and runs as platform dependent native code. This should already tell something about performance.

For a "case-study" check out the following blog post:

From zero to Go: launching on the Google homepage in 24 hours

This blog also contains some performance report of a real-world app used by millions:

dynamic requests

This chart - taken directly from the App Engine dashboard - shows average request latency during launch. As you can see, even under load it never exceeds 60 ms, with a median latency of 32 milliseconds. This is wicked fast, considering that our request handler is doing image manipulation and encoding on the fly.

App Engine uses the web server that is included in the Go standard library to serve your app, so that also means you can easily port a Go web app to App Engine, and that you know exactly what to expect from the web server serving your app on App Engine.

Found Official time comparisions of Python, Java and Go

The App Engine System Status can be considered official and a good comparision base.

You can click on any cells belonging to a specific day and language, and you get detailed historical statistics for Static and Dynamic GET latency (both secure and unsecure), Error rates, CPU usage/latency. These statistics are measured on an instance that is already up and ready to serve.

Analysing it for the day of January 27, 2015 here are the conclusions for Go, Java and Python:

  • Dynamic latency is roughly the same for all
  • CPU latency (to compute the 33rd Fibonacci number) is best for Java, then Go and slowest is Python.
  • Static file serving time is roughly the same but Go is fastest.
like image 179
icza Avatar answered Oct 03 '22 01:10

icza