Issue
Are there any EC2 configurations for timeout?
I have a dedicated EC2 server and there is a docker containerized .net 5.0 web API served on it. When I try to send long-running requests I get 504 Gateway Timeout after 90 seconds and I can see that requests end after 120 seconds on the logs in cloudwatch. Is there any EC2 configurations for timeout?
Solution
Why did I come up with this background service idea?
Reason 1: The browser will have a limit of about 4 minutes.
The request timed out. The web server failed to respond within the specified time.
If we call the long http running API in our UI page, the browser may crash.
Reason 2: There are some third-party services, such as Azure Gateway and other related services that I am familiar with, have a 120s limit, and if the time is exceeded, there will be 504 errors. It same as your EC2.
Solution
Related links
Asp.Net core long running/background task
How to implement the more reliable approach
Answered By - Jason Pan Answer Checked By - Candace Johnson (WPSolving Volunteer)