Skip to content

Commit f34edd3

Browse files
AlexanderWertbmorelli25trentm
authored
Added performance impact section to the docs (#279)
* Added performance impact section to the docs * Update docs/monitoring-aws-lambda.asciidoc Co-authored-by: Brandon Morelli <[email protected]> * Update docs/monitoring-aws-lambda.asciidoc Co-authored-by: Trent Mick <[email protected]> * Update docs/monitoring-aws-lambda.asciidoc Co-authored-by: Trent Mick <[email protected]> * Update docs/monitoring-aws-lambda.asciidoc Co-authored-by: Trent Mick <[email protected]> * Update docs/monitoring-aws-lambda.asciidoc Co-authored-by: Brandon Morelli <[email protected]> * Update package size numbers in doc Co-authored-by: Brandon Morelli <[email protected]> Co-authored-by: Trent Mick <[email protected]>
1 parent 5042e84 commit f34edd3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/monitoring-aws-lambda.asciidoc

+25
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@ image:images/architecture-white.png[image showing data flow from lambda function
2828

2929
By using an AWS Lambda extension, Elastic APM agents can send data to a local Lambda extension process, and that process will forward data on to APM Server asynchronously. The Lambda extension ensures that any potential latency between the Lambda function and the APM Server instance will not cause latency in the request flow of the Lambda function itself.
3030

31+
[[aws-lambda-overhead]]
32+
== Performance impact and overhead
33+
As described in <<aws-lambda-arch>>, using Elastic APM with AWS Lambda requires adding both the Elastic APM AWS Lambda extension and a corresponding Elastic APM agent to the Lambda runtime.
34+
These components may introduce a small overhead on the size of your function's deployment package as well as the execution duration of your function's invocations.
35+
36+
=== Impact on the deployment package size
37+
These components contribute a little to the uncompressed deployment package size of your Lambda function. Overall, the impact of using Elastic APM on the uncompressed deployment package size of your Lambda function is less than 30MB.
38+
39+
=== Performance impact
40+
An advantage of the Elastic APM AWS Lambda extension architecture is that APM data dispatching is decoupled from your function's request processing.
41+
The Elastic APM AWS Lambda extension flushes APM data to the Elastic backend _after_ your function responds to the client's request. Thus, it does not affect the latency of the client's request.
42+
However, the extension's flushing of APM data contributes to the overall execution time of the function invocation.
43+
The <<aws-lambda-config-data-forwarder-timeout>> config option with the related _exponential backoff algorithm_ limits and allows to control the impact the extension may have on the function's overall execution time.
44+
45+
When your function experiences a cold start, the Elastic APM AWS Lambda extension needs to be initialized and, thus, slightly increases the cold start duration (in the range of tens of milliseconds) of your function.
46+
47+
APM agents enrich your application's code with measurement code that collects APM data. This measurement code introduces a small performance overhead to your application, which is usually in a negligible range. The same is true with Lambda functions. The concrete performance overhead introduced by APM agents highly depends on the configuration of the agent and on the characteristics of your function's code. The following agent-specific documentation pages provide insights and instructions on tuning the performance the APM agents:
48+
49+
* {apm-node-ref}/performance-tuning.html[Performance Tuning - Node.js]
50+
* {apm-py-ref}/tuning-and-overhead.html[Performance Tuning - Python]
51+
* {apm-java-ref}/tuning-and-overhead.html[Performance Tuning - Java]
52+
53+
Similar to the Elastic APM AWS Lambda extension, APM agents are initialized at cold start time. As a consequence, the APM agent's overhead will be higher for cold starts as compared to their overhead on _warm_ invocations. This effect is especially relevant for the Java APM agent on AWS Lambda. Learn more about corresponding tuning options in the {apm-java-ref}/aws-lambda.html#aws-lambda-caveats[Java Agent's AWS Lambda documentation].
54+
3155
[[aws-lambda-config-options]]
3256
== Configuration options
3357

@@ -67,6 +91,7 @@ The {apm-lambda-ext}'s timeout value, in seconds, for receiving data from the AP
6791
=== `ELASTIC_APM_DATA_RECEIVER_SERVER_PORT`
6892
The port on which the {apm-lambda-ext} listens to receive data from the APM agent. The _default_ is `8200`.
6993

94+
[[aws-lambda-config-data-forwarder-timeout]]
7095
=== `ELASTIC_APM_DATA_FORWARDER_TIMEOUT_SECONDS`
7196
The timeout value, in seconds, for the {apm-lambda-ext}'s HTTP client sending data to the APM Server. The _default_ is `3`. If the extension's attempt to send APM data during this time interval is not successful, the extension queues back the data. Further attempts at sending the data are governed by an exponential backoff algorithm: data will be sent after a increasingly large grace period of 0, then circa 1, 4, 9, 16, 25 and 36 seconds, provided that the Lambda function execution is ongoing.
7297

0 commit comments

Comments
 (0)