Report this

What is the reason for this report?

timeout settings for our server

Posted on October 28, 2024

we have the following timeout for external bot connecting with our https://statorium.com site https://clip2net.com/s/4lIWTcC

agency suggest increasing that timeout setting but we cannot find that under our droplet settings. We run Ubuntu 23.10 x64 on droplet, use cloudflare

can you suggest where we shall search for timeout settings please?



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.

Hey there!

The timeout settings for external connections on your Ubuntu server aren’t managed directly through the Droplet settings on DigitalOcean but can be configured in a few key places on your server itself which you have root access to.

As you’re using Cloudflare and an Ubuntu Droplet, here’s where you can look to increase the timeout:

  1. Cloudflare has a default timeout of 100 seconds for HTTP requests. Unfortunately, this is a fixed limit and can’t be extended directly through Cloudflare’s free plan. If you’re on a paid plan, you may have options to adjust this under “Load Balancing” or “Workers”, but it’s still limited. For more information check out their docs here: https://community.cloudflare.com/t/increase-cloudflare-max-request-duration/482873

  2. Nginx or Apache Timeout Settings on your Droplet:

    • If you’re using Nginx or Apache as your web server, you can adjust the timeout settings to handle longer connections.

    For Nginx:

    • Open the Nginx configuration file (usually located at /etc/nginx/nginx.conf or within /etc/nginx/sites-available/).
    • Add or update these directives within your server block:
      proxy_read_timeout 300s;
      proxy_connect_timeout 300s;
      proxy_send_timeout 300s;
      
    • Restart Nginx:
      sudo systemctl restart nginx
      

    For Apache:

    • Open the Apache configuration file, typically found at /etc/apache2/apache2.conf or in /etc/apache2/sites-available/.
    • Add or update these directives:
      Timeout 300
      ProxyTimeout 300
      
    • Restart Apache:
      sudo systemctl restart apache2
      
  3. PHP Timeout Settings:

    • If you’re running a PHP application, you may also want to increase the execution time for PHP scripts.
    • Open your PHP configuration file (php.ini, often located at /etc/php/8.2/fpm/php.ini or /etc/php/8.2/apache2/php.ini).
    • Update these settings:
      max_execution_time = 300
      max_input_time = 300
      
    • Restart PHP-FPM (if applicable):
      sudo systemctl restart php8.2-fpm
      

Feel free to share more details on the services that you are using if those are not the ones you use.

Also worth mentioning that, extending timeout settings too much can sometimes lead to performance issues, as long connections consume resources. Make sure these settings match your server’s capacity like RAM and CPU.

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.