2

Currently I develop REST API using laravel framework and I deploy it to both Google Cloud App Engine Standard and Flexible version.

When I deploy it to flexible version, it works fine. However, since my app still prototype, I want to change it to standard version so I can get the free tier because my app still use very little resources.

However, when I try to deploy to App Engine standard, everything still works, but the response quite slow, compared to flexible. I already tried to change the instance class to the highest spec machine, but still the same result.

So I try to find out what's going on, I thought App engine standard slower than flexible.

My findings:

App Engine Standard

Using App engine Standard request header standard

App Engine Flexible

Using app engine Flexible request header flexible

As you can see, the standard and flexible request to the same API endpoint, however, in standard version, the response return not in gzip encoding and more bytes were return, while flexible version return in gzip encoding.

I think that might be the problem why every request become slow. In Flexible, mostly the request return under 1000 ms, while in standard most of the time around 2000 ms.

Do you guys have any idea how to enable gzip compression in App Engine Standard, or do you think there is other problem that cause the response to be slow.

Thank You for your help :).

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
Indra
  • 21
  • 1
  • Can you show the corresponding handler code? – Dan Cornilescu Nov 14 '18 at 13:05
  • Not sure if this is what you're looking for but I found this in the documentation https://cloud.google.com/appengine/docs/standard/php7/how-requests-are-handled#response_compression – anon Nov 14 '18 at 16:35
  • @DanCornilescu do you mean this handler? handlers: - url: /favicon\.ico static_files: public/favicon.ico upload: public/favicon\.ico – Indra Nov 15 '18 at 00:42
  • 1
    @anon I have read that article, as you can see on the image above, I did sent the accept encoding to gzip for both standard and flexible, but still it won't return me gzip, I also tried this website https://checkgzipcompression.com/ but the result also shows that no gzip for standard. Is there any script to enable it? – Indra Nov 15 '18 at 00:45
  • That handler is for `favicon.ico` (which is a static file served by GAE infra directly, not by your app), but the header info you showed appears to be for `getShopToken`, which I suspect is content served by your app, not a static one. Can you confirm/clarify? – Dan Cornilescu Nov 15 '18 at 03:43
  • @DanCornilescu, yes it's not a static one, but same configuration on flexible version, and getShopToken return with gzip, while in standard no gzip – Indra Nov 15 '18 at 14:23

0 Answers0