policy
platform_limits
ai_generated
partial
Vercel serverless function times out at 10s even though code completes in time locally
ID: policy/vercel-serverless-timeout-by-plan
72%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Vercel serverless function timeout varies by plan: Hobby=10s, Pro=60s, Enterprise=900s. The Hobby 10s limit is not prominently shown in docs. Database connections, external API calls, and cold starts easily exceed 10s.
genericWorkarounds
-
90% success Upgrade to Pro plan for 60s timeout if 10s is insufficient
Vercel Pro: $20/month, 60s function timeout. Often the simplest fix for timeout issues.
-
88% success Use background functions (Vercel cron or queued) for long-running tasks
Use Vercel's maxDuration in vercel.json and Background Functions for tasks >10s
-
85% success Move long-running tasks to external services (AWS Lambda, Cloud Functions)
Trigger external function via HTTP from Vercel edge. External function has its own timeout limits.
Dead Ends
Common approaches that don't work:
-
Optimize function code to run within 10 seconds
82% fail
10s includes cold start time (1-3s for Node.js, 5-10s for Python/Java). Actual code execution budget is 7-9s. With a database connection, you may have <5s for logic.
-
Use Edge Functions for longer execution time
75% fail
Edge Functions have even lower limits (some regions enforce shorter timeouts) and don't support all Node.js APIs. They're for fast, lightweight transformations.