I use App Platform to host my plotly dash app. It is connected to my github repo and builds after every push. The app builds and deploys fine (with default config, no custom changes) and seem to work fine until I click the button in the app which triggers a python code on the backend. Normally, this would take 3-5 seconds in my laptop (16 gig memory, 8 cpu, 2.40 ghz), but it takes too long time that it hits timeout limit (pro plan 1 gig mem and 1 vCPU).
These are the messages I have, total 6 lines. As I search through web, I’ve seen several answers around docker memory limits, and gunicorn timeout duration. Hence, I tried extending timeout duration to 180, and to 240 seconds (the process shouldn’t last that long anyway), but didn’t help. Also, I increased the resource to pro plan 8 gig mem and 2 dedicated CPUs, but same happened again, didn’t help at all.
I was looking for a way to increase the memory of the image using “build command” option but was not able to do so.
Do you have any clue what it is about?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
As per Bobby’s comment, you can enable logging to get more information about the timeout.
On another note I can see this warning message:
You can check the logs if some part of the script is terminated due to resource usage or a similar reason.
As your code runs in 3-5 seconds locally, it sounds like that your Python code is trying to connect to an external system and the request is timing out. Can you verify if this is the case?
For example, if you are connecting to an external database cluster you might have to open the database port so that your Python code could connect to the database instance.
What you could also do is to enable some more logging so that you could record more information on what function or call exactly is causing the timeout.
Let me know how it goes!