I am building a flask app that takes a long time to return (minutes) after receiving a GET request. I noticed that when I try to stress test the server by sending 5 concurrent requests, the backend can still be running normally, but the front end would timeout with the following message. I already set a very generous gunicorn worker timeout so that the backend would not timeout. I cannot reproduce this locally and I failed to find which digital ocean setting controls this behavior.
Error
We encountered an error when trying to load your application and your page could not be served. Check the logs for your application in the App Platform dashboard.
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.
Hi there,
It sounds like that your app is making an external request to a database or another system which might be timing out. Usually if the request to an external system takes too long to respond or is unreachable, it could cause your Flask app to hang, leading to a timeout error on the frontend.
Does this happen on every single GET request or just on a specific request?
I could suggest enabling the debug for your Flaks app and checking if there will be some more useful information in the logs that might point you to the direction on what might be causing the issue.
Also, if you were to open your web console, and then go to the Network tab, do you see specific requests that are pending?
Best,
Bobby