node.js - Sam local with NodeJS - 请求在哪里花费这么多时间
问题描述
我已经编写了一个 NodeJS lambda 函数,我正在使用sam local
. 我注意到浏览器下载它所花费的时间比我从日志中看到的 lambda 执行要多得多。Chrome 显示它在服务器响应之前等待了 6,13 秒。
2020-02-04 21:02:18 127.0.0.1 - - [04/Feb/2020 21:02:18] "GET /v1/verify/Yk6QwCF1 HTTP/1.1" 502 -
Invoking src/handlers/users/verifyUser.handler (nodejs10.x)
Fetching lambci/lambda:nodejs10.x Docker container image......
Mounting C:\dev\mezinamiridici\infrastructure as /var/task:ro,delegated inside runtime container
?[32mREPORT RequestId: 56060b6c-2bef-1241-03a4-fb2fca321096 Init Duration: 2238.80 ms
Duration: 127.36 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 59 MB ?[0m
2020-02-04 21:03:10 127.0.0.1 - - [04/Feb/2020 21:03:10] "GET /v1/verify/Yk6QwCF1 HTTP/1.1" 403 -
它应该是大约 2,5 秒。剩下的将近 4 秒用在了哪里?
解决方案
推荐阅读
- java - Eclipse:为 Workspace 中的所有项目更改 JDK
- php - Laravel where 在控制器的更新语句中
- android - Kotlin 处理程序类:如何在满足条件时从 run() 内部停止线程?
- c# - 有两个不同的依赖程序集但具有相同的公钥令牌是否正常?
- python - 如何通过请求从自定义表单的输入文本字段中获取值:Django 3.0?
- javascript - 如果选择了按钮,则 jQuery 显示/隐藏选项
- laravel - 在laravel中提交后打印结果
- python-3.x - 创建一对连续的时间列表
- php - Laravel 部署:PHP 错误无法加载动态库“pdo_pgsql”
- vuejs2 - 从数据库读取数组后如何触发手表?