All Products
Search
Document Center

Function Compute:What do I do if a function execution times out and "Function time out after" is reported?

Last Updated:Feb 27, 2026

Error message

When a function invocation exceeds the configured Execution Timeout Period, Function Compute terminates the execution and returns the following error:

Function time out after

Diagnose the root cause

Before applying a fix, identify why the timeout occurs:

  1. On the Logs tab, click Enable to turn on logging. Logs tab with Enable button

  2. Configure request-level metric logs for services to capture per-request duration and status. Logging configuration

  3. Review the logs to determine which operation or logic branch consumes the most time.

  4. Match your findings to one of the causes below.

Cause 1: Function code execution exceeds the Execution Timeout Period

The function takes longer to run than the configured Execution Timeout Period value.

Solution

Increase the Execution Timeout Period value. For instructions, see Update a function.

Execution Timeout Period setting in console

If the function already runs near the maximum allowed timeout, optimize the function code instead.

Cause 2: An external API call blocks execution

The function calls an external API that responds slowly or not at all, causing the total execution time to exceed the Execution Timeout Period.

Solution

  1. Configure request-level metric logs for services to identify which request takes the longest.

  2. On the Logs tab, click Enable to enable logging if not already enabled.

  3. Review the logs to confirm which API call causes the delay.

  4. Increase the Execution Timeout Period if the downstream API legitimately requires more time. For instructions, see Update a function.

Cause 3: A CPU-intensive logic branch is accessed

The function enters a CPU-intensive logic branch, such as a large computation, that prevents it from completing within the Execution Timeout Period.

Solution

  1. Review the function code for CPU-intensive logic branches.

  2. Optimize the identified logic where possible.

  3. If the CPU-intensive work cannot be reduced, increase the Execution Timeout Period to accommodate the processing time. For instructions, see Update a function.

Summary

CausePrimary solutionSecondary solution
Execution time exceeds Execution Timeout PeriodIncrease the Execution Timeout Period valueOptimize function code
External API call blocks executionEnable logging to identify the slow API callIncrease Execution Timeout Period
CPU-intensive logic branchOptimize or restructure the logicIncrease the Execution Timeout Period value

For all causes, enable logging and configure request-level metric logs to gain visibility into function execution behavior.