0

I have an Appengine standard environment with an application that exposes a series of REST services to consume, everything works alright but the response times are a bit high. The first request takes around 40 seconds to respond, after that the response time it's in milliseconds, if the service it's unused for a while, this happen again.

I understand that the instance initialization causes the delay and that an instance can be disposed if it's being unused, so I tried to change the scaling type, and the best result so far has been automatic-scaling with 1 idle-instance minimum, but the problem still persist.

I also programed a cron-job that continuously calls a service so that the instance can't be disposed, didn't work.

What's the proper way to manage the instances so that the services can be available at a low response time? This is expected in a standard environment? Is this problem solved by switching to a flexible standard?

1 Answers1

0

It seems that your app is behaving as expected upon encountering a Loading Request. This happens because the application undergoes initialization where it must first load any libraries and resources required to handle users' requests.

I think you can improve your Application's performance by following the best practices in here [1].

What you mention about App Engine Flex is also true. In there you will have an instance always running.

[1] https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#loading_requests