English 中文(简体)
规定的一致性对Lambda职能的反应时间的影响不大。
原标题:Provisioned concurrency has minor impact on response time of Lambda function

我们正在与AWS Lambda和APIC网关一道使用一个没有服务器的建筑。 The execution time of the lambda is in the range of a smallilliseconds. <final response at the claimant s end is received in seconds (即使考虑到冷开假设情景,也考虑到时段内的时间,这远远超出了“拉姆宾达”的执行时间。)

在利用AAP网关卡进行清点的同时,二者的一体化相对性使终端对终端的反应速度大大放慢。 为了消除 in年或寒冷的开端,我在云瓦特加增加了规则,定期呼吁拉姆布达斯保持热情。

停职时间被完全取消,这也有助于减少一体化的相对性。 还有一些Lambdas,因为要求他们作认证,因此我增加了5个同意。

This Lambda has init duration as well in the logs. Lambda provisioning is another option to get rid of cold-starts but this is not having impact over the time in which Lambda s response is available at API gateway.

下面,我与拉布达斯联系,向拉布达斯分配了经费。

我在拉宾达的云层标志中补充了:

<代码>Dur:1331.38 ms Billed Duration: 1332 ms Memory Size: 256 MB Max Memory Used: 130 MB Init Duration: 1174.18 ms

我在Aurentway和Lambda记录中可以注意到的一件事是,从Arend关处向Mlambda发送了请求书,编号为:2021-02-15T11:51:36.621+05:30 <0>>,但在Lambda收到。 在拉布达提出请求时,有大约2次拖延。

<>AWS X-RAYTRACING

“

我使AWS X-Ray伐木得以用于APIC网关和Lambda,这是我从痕迹中看到的。 这项请求共涉及595个ms,但在邮局收到了1558个ms的答复。 从哪里,从APIC网关收到答复后又增加了大约1秒的延迟?

“entergraph

问题回答

我认为,理由是,5项规定的同意还不够,你仍然冷静地开始履行兰巴达的职能。 这意味着,如果外部部门称号是你的APIC末点(即你的Lambda在APIC网关后运作),那么你兰巴达的职能是5个例。 如果我们履行兰巴达职能,可以处理每秒2次(每次500米)的申请,那么你可以大致处理每第二次10次请求,并履行拉布达的职责。 如果外部服务机构每二次提出20项要求,AWS Lambda就试图提出新的事例,因为现有要求忙于处理。 结果是,外部服务由于你工作的冷静开,反应时间很高。

此外,认为你兰巴达的职能并非“永远”而是在一段时期后清理的。 也就是说,如果你在交通模式上经历了多次猛进,这就意味着,在一次猛涨之后,情况就好像15分钟,那么AWS Lambda就将其关闭,只剩下5个供应方,如果再发生另一起上升,你就认为问题与以前一样。

www.un.org/Depts/DGACM/index_spanish.htm 请注意: 这是对幕后发生的事情的非常简化的解释,也是你描述的更好的猜测。 如果你提供一些实例(例如,在时间、执行期间、答复时间),并且可能有一些实例说明你在兰巴达职能中所做的工作。 另外,你使用什么时间? 你们的交通模式如何看待?

Potential solutions

  • Reduce the cold start time of your Lambda functions -> always a good idea for Lambda functions that are behind an API Gateway
  • Provision more instances -> only possible up to a certain (soft) limit

================================================================================================================================================================================================================================================================ 服务流动 ================================================================================================================================================================================================================================================================

AP GW ⮕ Lambda功能(预设)

================================================================================================================================================================================================================================================================ 学历 ================================================================================================================================================================================================================================================================

你们想理解为什么在处理APIC GW至Lambda的要求时有相对性。

================================================================================================================================================================================================================================================================ 及时的妇女 ================================================================================================================================================================================================================================================================

021-02-15T11:51:36.621+05:30 2021-02-15T11:51:38.535+05:3 Lambda duration - Duration: 1331.38 ms Billed Duration: 1332 ms Memory Size: 256 MB Max Memory Used: 130 MB Init Duration: 1174.18 ms

==后续问题 ================================================================================================================================================================================================================================================================

虽然这项请求通过APIC-GW处理到Lambda的运行,但执行部分耗用了1174.18 ms(1.1s)小段作为“积极和安放”部分;在其余0.3条中执行你的代码,使总数达到1.4秒。

Q. What is the type of processor you are using? Q. Type of API & Endpoint type?

================================================================================================================================================================================================================================================================ K.C ====

  1. You should read AWS DOC for optimizing your Lambda function code.Optimizing static initialization
  2. Lambda won t charge you for the time it takes to initialize your code (e.g. importing stuff) as long as it finishes in about X seconds.1

===== Replication Observation =====

没有规定同意。

  1. API GW execution time - 286 ms
  2. Initialization -195ms
  3. Invocation - 11ms
  4. Overhead - 0ms

同意。

  1. API GW execution time - 1.103ms
  2. Initialization - 97ms
  3. Invocation - 1ms
  4. Overhead - 0ms

I m in US-WEST-2 region and calls the request from 12,575公里远的地方。 I hv a REST AP, 配置为区域终点类型。 设在X86的加工商的Lambda功能在X86_64——64-bit x86建筑。

-- Check if you have optimized Lambda function code. -- To have low latency, you may make use of edge optimized Rest API.An edge-optimized API endpoint is best for geographically distributed clients. API requests are routed to the nearest CloudFront Point of Presence (POP). -- Alway choose the Region which is closest to the high traffic region.

-- References:

new-provisioned-concurrency-for-lambda-functions provisioned-concurrency.html#optimizing-latency





相关问题
AWS Lambda Node JS Promise Rejection

I m having an issue with one of my AWS Lambda Node JS functions when I call the function from axios in my Next JS frontend. The first time the function is called, it is successful and returns ...

Python lambda function returns ErrorType KeyError

i am creating a lambda function for Certification expiration Alert, and getting this error message when Test run Response { "errorMessage": " detail-type ", "errorType&...

Enable CORS in AWS API Gateway with aws-cli

I m currently writing script to programmatically enable CORS once a resource is added to an API Endpoint on AWS API Gateway. After exploring the put-integration-response function for hours. I almost ...

热门标签