Skip to content

Commit 23b4bb3

Browse files
Add memory overhead doc (#2895)
1 parent 2a87d84 commit 23b4bb3

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

docs/sources/configure-client/aws-lambda.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ For more details, refer to the [Building Extensions for AWS Lambda blog post](ht
3535

3636
## Set up the Pyroscope Lambda extension
3737

38-
To set up the Pyroscope Lamnda extension, you need to:
38+
To set up the Pyroscope Lamnda extension, you need to:
3939

4040
1. Configure your Lamda function
41-
1. Set up your environment variables
41+
1. Set up your environment variables
4242
1. Integrate the Pyroscope SDK
4343

4444
### Configure your Lambda function
4545

4646
Configure your Lambda function to use the extension. Find the latest release on our [releases page](https://github.com/grafana/pyroscope-lambda-extension/releases).
4747

48-
### Set up the environment variables
48+
### Set up the environment variables
4949

5050
Configure the extension with the following environment variables:
5151

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Pyroscope memory overhead
3+
menuTitle: Memory overhead
4+
description: Learn about memory overhead for the Pyroscope client.
5+
weight: 200
6+
---
7+
8+
# Pyroscope memory overhead
9+
10+
Pyroscope has very low memory overhead, usually less than 50 MB per pod.
11+
12+
## How the profiler works
13+
14+
Stacktraces are captured at regular intervals (~100Hz).
15+
Memory allocations and lock contention events are sampled.
16+
17+
These stacktraces and memory allocation events are temporarily stored in memory.
18+
19+
The stored profiling data is periodically (default is every 15 seconds) sent to the server.
20+
21+
Memory overhead consists of:
22+
23+
* The temporary storage of profiles in memory is the primary contributor to memory overhead.
24+
* Memory usage typically scales up sublinearly with the number of CPUs.
25+
26+
## What happens if the Pyroscope backend is down?
27+
28+
The guiding principle of Pyroscope clients is to never cause the user application to crash.
29+
30+
Profiles are uploaded using multiple threads. The default value is `5` and can be adjusted using the `Threads` variable.
31+
32+
If the backend is down or slow, the profiler discards new profiles to prevent running out of memory.
33+
34+
## Real-world example
35+
36+
The exact overhead can vary based on the application, so direct testing is recommended.
37+
38+
At Grafana Labs we continuously profile all of our workloads.
39+
With all profiling types enabled (CPU, alloc, goroutine, mutex, block), the observed memory overhead per pod is typically less than 50 MB.
40+
41+
The overhead is often so minimal that it becomes challenging to accurately measure.

0 commit comments

Comments
 (0)