Home > other >  Google cloud's app engine (FLASK)'s memory exceeded
Google cloud's app engine (FLASK)'s memory exceeded

Time:12-02

I have an API exposed through Flask App Engine and triggered through a GCP Task, And the code I'm triggering is querying an external API that returns a very big response (using requests package).

From time to time I see that the task should be preformed again, and the reason for retrying according to google is: INTERNAL(13): Memory Exceeded. HTTP status code 500

By looking at the logs it seems that the operation stops when I'm waiting for the requests post to return.

How can I solve it? is there a way of changing the allocated memory that can be used by the App Engine?

And assuming that the response size is the same on every call, why does it sometimes work and sometime doesn't? Is the App Engine memory shared between all of the routes triggered?

CodePudding user response:

is there a way of changing the allocated memory that can be used by the App Engine <

Yes, via instance classes in your app.yaml file. An instance class determines the maximum amount of CPU & memory that is available for your project to use.

You should note that changing your instance class (using one with higher memory) might affect (increase) your bill unless you take extra care to stay within the free quota

Further (simplified) explanation of instance classes and how they show up on your bill can be found here

  • Related