AWS Lambda 任务在 6.00 秒后超时 [英] AWS Lambda Task timed out after 6.00 seconds

查看:21
本文介绍了AWS Lambda 任务在 6.00 秒后超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用无服务器框架.我的 Lambda 函数连接到 DynamoDB 表以更新表中的项目.阅读与表的写入容量单位为5&自动缩放被禁用.AWS Lambda 函数分配了 128MB 内存.

I am using serverless framework. My Lambda function connects to DynamoDB table for updating item in table. Read & Write capacity units of table are 5 & auto_scaling is disabled. AWS Lambda function has 128MB memory allocated.

我使用 Jmeter 进行性能测试.我同时发送了 1000 个请求,一些响应给了我完美的输出,而另一些则给了内部服务器错误(502 Bad Gateway).我还分析了 cloudwatch 的日志,只得到任务超时错误.谁能建议我为什么会收到此错误以及如何解决?

I have used Jmeter for performance testing.I have sent 1000 requests concurrently and some response giving me perfect output while other giving internal server error(502 Bad Gateway). i have also analyzed cloudwatch for logs and only get Task Timeout error. can anyone suggest me why i am getting this error and how to solve it?

推荐答案

使用无服务器框架时,AWS Lambda 函数的默认超时时间为 6 秒.只需将其更改为 文档 中所述的更高值:

The default timeout for AWS Lambda functions when using the Serverless framework is 6 seconds. Simply change that to a higher value as noted in the documentation:

functions:
  hello:
    ...
    timeout: 10 # optional, in seconds, default is 6

这篇关于AWS Lambda 任务在 6.00 秒后超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆