Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

App engine Flexible runtime >1Hour

Hi,

I am trying to run a python script that takes more than 1 hour of processing time and is memory intensive. I need to be able to run it when an http request is received from the user with a specific payload.

I tried using App engine standard with basic scaling but there was not enough memory to run my script.

App engine flexible gives a timeout response when I try to use it.

What's the best way to go about it.

Thanks

0 2 444
2 REPLIES 2

Hi @abhishekpwh

I would highly recommend that you use an App Engine Flexible. App Engine Flexible  can receive consistent traffic, experience regular traffic fluctuations, or meet the parameters for scaling up and down gradually.

Whenever you run a script more than an hour in App Engine Flexible it will always give you a timeout response due to the maximum request timeout is only 60 minutes or an hour.

Flexible environment always imposes a 60 minute timeout. To avoid leaving requests open for the full 60 minutes and potentially using up all threads on the web server:

  • When making calls to external services, specify a timeout.

  • Implement a servlet filter to stop requests that take an unacceptably long time, such as 60 seconds. Make sure your app can return to a consistent state after your filter stops a request.

If you need further help you may contact Google Cloud Support.

You may check this documentation for your reference about App Engine Flexible.

I'm not sure how this would answer his question. He's asking if there's a way to do processing for greater than 60 minutes. App Engine Flex obviously does not allow this but your answer provides no solution on how to circumvent this or any alternative that can help him get past timeout issues, i.e. perhaps using a different product altogether instead of App Engine.