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!
Hey @alexborg,
There shouldn’t be any limits on that on your Droplet. What do you see in your application’s log files?
Hi there,
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_time setting in your php.ini file, 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.ini file, increase the max_execution_time to 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.conf or applicable server block file, and increase fastcgi_read_timeout to a value higher than 60. For Apache, you can increase the Timeout directive in your httpd.conf file.
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!
Best,
Bobby
Hello,
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_read_timeout and proxy_connect_timeout directives to extend the connection timeout for your application. For example:
- location / {
- proxy_pass http://your_backend;
- proxy_connect_timeout 300s;
- proxy_read_timeout 300s;
- }
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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.