0
  • I have created Spring application in app engine B2, I can see in logs that application takes 1s to complete data filtering(after wakening application up). When in my local machine it takes 10ms.
  • Data size is really small and logic is not so complex, just begining of the project.

So my questions is it possible that my app engine instance are lacking of some resources or smth? Maybe I am lacking of some configuration or JAVA OPTIONS, because now I use default. Maybe someone has faced similar permormance issues.

Update. Again I have tried to use B1 B2 B3 B4 instances. Same results. Feels like the applications has really small amount of resources.

Problem solved, when I created Compute Engine VM. In virtual machine I have running docker image with the same application. And now it works fine. Responses are great.

I would love to use App Engine, but still cannot figure out what causes this. I use all default settings of app.yaml from google tutorials with no additional options.

Update 2. I have tried to use App Engine Flex environment, with different options. Still same result. Maybe I can see difference when I am calling same API for more times instead 30s response I get 28 25. So my conlclusion is that App engine (in my understanding) is not suitable to work with JAVA complex CPU peak operations (FILTER, SORT ENTITY) .. On Compute Engine my solution works fine. Then I went to try on GKE and as well it works perfect there from 30s (without startup overhead) response decreased to 200ms. In GCE or GKE i use lowest resource rank VM.

Vilius
  • 1
  • 1

1 Answers1

0

Through changing the instance class to one even more efficient for computational operations (such as a instance class of B4, with a higher CPU Limit, in your case) would indeed make your application faster in that regard, but it will however cost more.

Before upgrading your instance class, we would recommend guaranteeing that nothing can be done programmatically to enhance the speed of your application as the price in this case will likely double.

KevinH
  • 101
  • I have tried to put on instace class B4 but still same result. Simple Spring boot stream.filter operation which take 20ms in local machine, takes 1s in app engine instance. Logs shows it clear. – Vilius Aug 26 '20 at 07:29
  • Thanks for attempting to upgrade the instance and I am sorry that the upgrade did not change the end result. In order to further investigate a possible solution, would it be possible to provide a snippet of code regarding your stream filter operation as well as the logs you are referencing? This will allow me to gain insight into the application code to identify any particular cause for concern. This will also allow me to investigate the logs you are referencing. – KevinH Aug 30 '20 at 03:48
  • Please also note that a instance needs to be [created](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#startup) and must go through startup operations when responding to a request. This may be adding to the overall time it takes to complete the operation. – KevinH Aug 31 '20 at 01:16
  • Thanks for the answers, but code is not the problem, its simple filter operation looping trough 1000 elements filtering them. I have updated my question with work progress. – Vilius Sep 02 '20 at 14:36
  • Thanks for updating your initial question! From what I can understand, the fact that this operation is performing well on a compute engine instance is likely due to the fact that there is no instance startup overhead. When using App Engine on automatic scaling, instances are scaled based on the overall traffic the application is receiving as identified by [public documentation](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#scaling_types). – KevinH Sep 13 '20 at 01:10
  • When the instance is idle, it will shut down and then a new instance will need to be created. The same goes for [Basic Scaling](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#scaling_types), however you can setup the time alloted before shutdown with "idle_timeout" in the app.yaml. – KevinH Sep 13 '20 at 01:10
  • The best way to utilize App Engine Standard without the instance startup overhead would likely be to use [Manual Scaling](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#scaling_types) as the instances available are set manually and last indefinitely unless shutdown manually. Please bear in mind that the instances will still need to be created initially. – KevinH Sep 13 '20 at 01:14
  • If utilizing App Engine Flex, rest assured that [manual scaling](https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed#instance_scaling) is available. – KevinH Sep 13 '20 at 01:18
  • Please let me know if these details have proven useful to the resolution of your issue, and if you may have any concerns. – KevinH Sep 13 '20 at 01:20
  • Thank you for the, help. But still I did not managed to embrace App Engine. I updated my question – Vilius Sep 13 '20 at 10:19
  • I'm glad that you were able to find a workaround in the end. If you are interested in digging deeper in finding whether or not there are possible limitations for the App Engine instance for data filtering operations, please consider opening a [technical case](https://cloud.google.com/support). This would be the best means for the GCP Support team to investigate this issue with the App Engine Specialists and provide you with direct assistance in this matter. – KevinH Sep 15 '20 at 19:27