debugging-lambda-timeouts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Debugging Lambda Timeouts

Lambda超时调试

Overview

概述

Domain expertise for systematically investigating AWS Lambda function timeout failures by analyzing function configuration, CloudWatch logs, metrics, dependencies, cold start patterns, and code. Identifies common causes such as insufficient timeout settings, external service delays, database connection issues, memory constraints, and inefficient code patterns, then provides prioritized recommendations.
本领域专长用于通过分析函数配置、CloudWatch日志、指标、依赖项、冷启动模式及代码,系统排查AWS Lambda函数超时故障。识别常见原因,如超时设置不足、外部服务延迟、数据库连接问题、内存限制及低效代码模式,并提供优先级排序的建议。

Debug a Lambda timeout

调试Lambda超时

To investigate and resolve Lambda timeout issues, follow the procedure exactly. See Lambda timeout debugging procedure.
The procedure collects function configuration, CloudWatch metrics and logs, dependency analysis, and cold start patterns. If Lambda code is provided, it also reviews the code for timeout-prone patterns. Results are compiled into a structured debugging report with prioritized recommendations.
如需排查并解决Lambda超时问题,请严格遵循以下流程。详见Lambda超时调试流程
该流程会收集函数配置、CloudWatch指标与日志、依赖项分析结果及冷启动模式数据。若提供了Lambda代码,还会检查代码中易导致超时的模式。最终结果将整理为包含优先级排序建议的结构化调试报告。

Troubleshooting

故障排查

Function not found

函数未找到

Verify the function name and region. Use
aws lambda list-functions --region <region>
to list available functions.
验证函数名称和区域。使用
aws lambda list-functions --region <region>
命令列出可用函数。

No logs available

无日志可用

The function may not have been invoked recently or logging may be disabled. Check the function's log group configuration and invocation metrics.
该函数可能近期未被调用,或日志功能已禁用。请检查函数的日志组配置和调用指标。

Access denied errors

访问被拒绝错误

Verify AWS credentials have permissions for Lambda, CloudWatch Logs, and CloudWatch Metrics. See the full procedure for details.
验证AWS凭证是否拥有Lambda、CloudWatch Logs和CloudWatch Metrics的权限。详情请查看完整流程。

Log query time range issues

日志查询时间范围问题

If CloudWatch Logs Insights queries fail with time range errors, reduce the analysis window or check log group retention settings. See the full procedure for details.
若CloudWatch Logs Insights查询因时间范围错误失败,请缩小分析窗口或检查日志组保留设置。详情请查看完整流程。