FUNCTION_THROTTLED

The FUNCTION_THROTTLED error occurs when your Vercel Functions exceed the concurrent execution limit, often due to a sudden request spike or backend API issues. For more information, see What should I do if I receive a 503 error on Vercel?.

Although this is a rare scenario, this error can also occur when Vercel's infrastructure encounters an abnormal system load and tries to mitigate the impact autonomously.

I'm encountering an error and reviewing the docs at /flg~eyJhbGciOiJIUzI1NiJ9._f7-_v4.UOF4sbL_iSEWy1pmGRdwrOZv9ecwg1vMZdA-QM_6bpc/docs/errors/FUNCTION_THROTTLED to understand what's happening. Please help me resolve this by: 1. **Suggest the fix**: Analyze my codebase context and propose what needs to be changed to resolve this error 2. **Explain the root cause**: Break down why this error occurred: - What was the code actually doing vs. what it needed to do? - What conditions triggered this specific error? - What misconception or oversight led to this? 3. **Teach the concept**: Help me understand the underlying principle: - Why does this error exist and what is it protecting me from? - What's the correct mental model for this concept? - How does this fit into the broader framework/language design? 4. **Show warning signs**: Help me recognize this pattern in the future: - What should I look out for that might cause this again? - Are there similar mistakes I might make in related scenarios? - What code smells or patterns indicate this issue? 5. **Discuss alternatives**: Explain if there are different valid approaches and their trade-offs My goal is to fix the immediate issue while building lasting understanding so I can avoid and resolve similar errors independently in the future.

To troubleshoot this error, follow these steps:

  1. Check application logs: Review the application logs to identify any specific errors related to the Vercel Function being invoked. For example, your function might be waiting for a slow backend API without a reasonable timeout. These information can be found at the host URL under the /_logs path, as well as the Observability tab in the Vercel dashboard.
  2. Handle request spikes: If you're experiencing a sudden spike in requests, consider using the Vercel Firewall to block unwanted traffic, or enabling Rate Limiting to limit the number of requests per second.
  3. Optimize your function: Review your function code to ensure it's optimized for performance. For example, you can use Vercel Edge Cache to cache responses and reduce the number of invocations. You can also enable fluid compute to handle more requests concurrently on a single function instance.

Was this helpful?

supported.