By ashih
Hello,
I have a NodeJS web server deployed on DigitalOcean as App (not Droplet). To stress test if DigitalOcean will force timeout (Heroku will force timeout at 30 seconds), I have a route to dynamically delay the response:
app.get("/sleep", async (req, res) => {
const minutes = parseFloat(req.query.minutes) || 0;
await sleep(minutes);
res.json({ status: `I slept for ${minutes} minutes` });
});
A request of 2 minutes returned this error:
<h1>A timeout occurred</h1>
<p>The origin web server timed out responding to this request.</p>
Is it possible to configure a DigitalOcean App to not force timeout?
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!
Hi @ashih,
The timeout error is thrown by Cloudflare and this error occurs if the server was not able to respond within 100 seconds. Cloudflare considers the connection as dead after 100 seconds and terminates it. Unfortunately, we cannot customize or disable the Cloudflare limits. Please optimize the code or switch to a higher plan with more resources to process the request before the timeout limit of 100 seconds is triggered.
Cheers, Ahmed
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.