We have some code that takes over 60 seconds to execute, DO is returning a 504 at exactly 60s is there any way to extend this timeout for our droplet?
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!
If you’re receiving a 504 Gateway Timeout error after 60 seconds, you may need to adjust the timeout settings for your web server or proxy server (e.g., Nginx or Apache). I’ll give you an example of Nginx:
In your Nginx configuration file, you should modify the
proxy_connect_timeoutdirectives to extend the connection timeout for your application. For example:
Remember to restart Nginx after making changes to the configuration file.
For more information on Nginx timeouts, please visit the DigitalOcean Docs.
If you’re using a different web server, please refer to its specific documentation for adjusting timeouts.
Hope that this helps!
With a Droplet, you do have full access to make any configuration changes as needed. For example, in the context of a PHP app, this is likely due to PHP’s
max_execution_timesetting in your
php.inifile, or the timeout settings of your web server (Apache, Nginx etc.).
To fix this, you can try the following:
Increase PHP’s max_execution_time: Edit your
php.inifile, increase the
max_execution_timeto a value greater than 60. For example, to set it to 5 minutes, you’d use:
max_execution_time = 300. Remember to restart your web server to apply the changes.
Adjust Server Timeout Settings: If you’re using Nginx, edit your
nginx.confor applicable server block file, and increase
fastcgi_read_timeoutto a value higher than 60. For Apache, you can increase the
Timeoutdirective in your
If you are not using PHP, feel free to share more details on the tech stack that you are using and I will be happy to advise you further!
There shouldn’t be any limits on that on your Droplet. What do you see in your application’s log files?