Edge Function takes too long to respond
Last edited: 2/6/2026
Edge Functions have a 60-second execution limit. If your function is taking too long to respond, follow these steps to diagnose and optimize performance.
Diagnose the issue
- Check function logs: Navigate to Functions > [Your Function] > Logs in the dashboard
- Examine boot times: Look for
bootedevents and check for consistent boot times - Identify bottlenecks: Review your code for slow operations
Analyze boot time patterns
-
If boot times are consistently slow: The issue is likely in your function's code, such as a large dependency, a slow API call, or a complex computation. Focus on optimizing your code, reducing dependency size, or implementing caching.
-
If only some boot events are slow: Find the affected
regionin the metadata and submit a support request via the "Help" button at the top of the dashboard.
Optimize database queries
Inefficient database queries are a common cause of slow responses:
1// Good: Only select needed columns and limit results2const { data } = await supabase.from('users').select('id, name').limit(10)34// Avoid: Fetching all columns from large tables5const { data } = await supabase.from('users').select('*')Common causes of slow functions
- Large dependencies: Heavy packages increase boot time
- Slow external API calls: Third-party services with high latency
- Complex computations: CPU-intensive operations
- Unoptimized database queries: Fetching more data than needed
- Cold starts: First invocation after idle period takes longer