Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

Parts of my site time out on Vercel but work on my computer

Short answer

Vercel stops a function that runs longer than its maximum duration. With fluid compute the default is 300 seconds on every plan, and the maximum is 300 seconds on Hobby and 800 on Pro and Enterprise. A timeout usually means something slow is waiting, such as a database, an outside service or a large job.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • A form or report works on the developer's computer and fails live.
  • Visitors see a gateway timeout or a blank page after a long wait.
  • It only fails for large orders, big files or busy times.
  • Emails or payments are sometimes sent twice because the page was retried.
  • The same page works on the second try.

Why does this happen?

  1. Functions have a maximum run time

    Vercel states that if a function runs for longer than its maximum duration, Vercel terminates it. Its table shows a default and a maximum of 300 seconds on Hobby, and a default of 300 seconds with a maximum of 800 seconds on Pro and Enterprise, with fluid compute enabled.

  2. The limit may have been set lower in the code

    Developers can set a maxDuration per function, per folder in vercel.json, or in the project settings. A low value set for testing can stay in the code and cut real work short.

  3. Something the function waits for is slow

    A database far from the function, an outside service that is slow, or a query without an index makes each request take longer in production than on a developer's computer.

  4. The job is too big for a web request

    Importing thousands of rows, creating PDFs or calling several services in a row does not belong inside one visitor request. Vercel's docs point to Workflows for workloads that need unlimited execution time and to a guide on background jobs.

  5. Extra time costs more and has conditions

    Vercel says that changing the maximum duration gives an invocation more time before termination and that it balances normal work against runaway functions. Durations above 800 seconds are a beta for Pro and Enterprise.

What can I do about it today?

  1. List exactly what failsWhich page or action, with what data, at what time. Large inputs matter most.
  2. Check for double effectsIf an action may have run twice, such as an email, an order or a payment, check your own records before anyone retries it.
  3. Do not click the button again and againEach click can start another long run and repeat the side effects.
  4. Ask your developer for the function's configured durationVercel's CLI can show the maximum duration for a deployment. Ask for the value and for the time the slow step takes.
  5. Do not just ask for the longest time allowedRaising the limit can hide a slow step and lets runaway functions run longer. Decide after the cause is known.
  6. Keep a copy of the failing exampleSave the file, form data or order that fails, so it can be tested again.

When should I bring someone in?

  • Customers lose orders or data because of the timeout.
  • The failing action sends money or messages.
  • Raising the limit has not helped.

How do I handle it?

  1. Time each stepI add timing around the database calls, outside calls and file work to see which step takes the time.
  2. Fix the slow stepQueries, missing indexes, repeated calls and large payloads are fixed before any limit is raised.
  3. Move long work out of the requestA slow job is turned into a background job, with the page answering at once and showing progress.
  4. Make retries safeActions that send emails or take payments are made so a repeated run cannot do them twice.
  5. Set the duration on purposeWhere more time is justified, the value is set per function and written down with the reason.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Is the timeout the same on every plan?

Vercel's table shows the same 300 second default on Hobby, Pro and Enterprise, with maximums of 300, 800 and 800 seconds. Longer durations are a beta for Pro and Enterprise.

Why does it work locally?

A local run has no time limit and is usually close to the database. Production has both a limit and distance.

Can the limit just be raised?

Within the plan's maximum, yes. Whether you should depends on why the step is slow.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.