What do I do if a function times out with the error "Function time out after"?

Updated at:
Copy as MD

If a function invocation occasionally fails with the Function time out after error, you can increase the timeout, check function logic, or identify CPU-intensive code paths.

Problem

Function invocations occasionally fail with the error Function time out after.

Solutions

Use one or more of the following solutions to resolve the timeout.

Solution 1: Increase the Execution Timeout

If the function requires more time than the current timeout allows, increase the Execution Timeout.

For more information, see Manage functions.

Solution 2: Check the function logic and configure logging

Configure logging for the function and review the logs to determine whether the timeout is caused by latency or delays in outbound API calls.

Solution 3: Check for CPU-intensive code paths

Check whether certain input conditions trigger CPU-intensive code paths that cause the function to exceed its timeout.