apps/docs/content/troubleshooting/edge-function-takes-too-long-to-respond.mdx
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.
booted events and check for consistent boot timesIf 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 region in the metadata and submit a support request via the "Help" button at the top of the dashboard.
Inefficient database queries are a common cause of slow responses:
// Good: Only select needed columns and limit results
const { data } = await supabase.from('users').select('id, name').limit(10)
// Avoid: Fetching all columns from large tables
const { data } = await supabase.from('users').select('*')