Question

Requests timing out after ~30s, can't increase max_execution time?

Using the DO Sample Laravel PHP app on the App Platform, after deploying, can’t increase the execution time, unsure what’s causing the issue. Error from logs indicates

WARNING: [pool www] child 189 ... execution timed out, terminating

Tried introducing env vars, .user.ini, nothing helps.

image alt text
image caption

Can you please clarify the following:

  1. Where and how can I edit fpm-settings on the App Platform?
  2. What if I need more than 100s? Is that not possible at all on the App Platform? Even if dedicated? What sets that limit?

Submit an answer


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!

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
November 28, 2024

Heya, @petarsubotic

App Platform allows your app 30 seconds to execute a request before timing out. You can increase this time by editing your app’s .user.ini file and setting the max_execution_time value to a higher number. user.ini files allow you to configure and override PHP settings on a per directory basis.

You can also follow our docs here:

https://docs.digitalocean.com/support/my-php-app-is-timing-out-and-throwing-5xx-errors/

Hope that this helps!

Bobby Iliev
Site Moderator
Site Moderator badge
November 28, 2024

Hi there,

The easiest way to edit the php.ini settings is to add a .user.ini file to your codebase with the following lines in it:

max_execution_time=90

You can check out the guide here:

https://docs.digitalocean.com/support/my-php-app-is-timing-out-and-throwing-5xx-errors/

The App Platform has a hard timeout limit of 100 seconds for any HTTP request. Having an HTTP request running for more than 100 seconds is usually not recommended as this means that your users will wait for that to complete and do not have to refresh their browsers, long-running processes are generally not ideal for HTTP requests and are better handled using background jobs or asynchronous processing.

If you absolutely need to handle HTTP requests longer than 100 seconds, you can consider switching from App Platform to a Droplet. Droplets give you full control over server settings, including timeouts as you will have root access and you can make any changes that you need to.

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

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.