Skip to content

Commit f467ae7

Browse files
Update Async Profiler doc (#12842)
1 parent ab94396 commit f467ae7

File tree

3 files changed

+42
-27
lines changed

3 files changed

+42
-27
lines changed

docs/en/concepts-and-designs/profiling.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ In the SkyWalking landscape, we provided three ways to support profiling within
1919
In-process profiling is primarily provided by auto-instrument agents in the VM-based runtime.
2020

2121
### Tracing Profiling
22-
Learn more tech details from the post, [**Use Profiling to Fix the Blind Spot of Distributed
23-
Tracing**](sdk-profiling.md).
24-
2522
This feature resolves the issue <1> through capture the snapshot of the thread stacks periodically.
2623
The OAP would aggregate the thread stack per RPC request, and provide a hierarchy graph to indicate the slow methods
2724
based
@@ -30,20 +27,25 @@ on continuous snapshot.
3027
The period is usually every 10-100 milliseconds, which is not recommended to be less, due to this capture would usually
3128
cause classical stop-the-world for the VM, which would impact the whole process performance.
3229

30+
Learn more tech details from the post, [**Use Profiling to Fix the Blind Spot of Distributed
31+
Tracing**](sdk-profiling.md).
32+
3333
For now, Java and Python agents support this.
3434

35-
### Async Profiler
35+
### Java App Profiling
36+
37+
Java App Profiling uses the [AsyncProfiler](https://github.com/async-profiler/async-profiler) for sampling
3638

3739
Async Profiler is a low overhead sampling profiler for Java that does not suffer from Safepoint bias problem. It features HotSpot-specific APIs to collect stack traces and to track memory allocations. The profiler works with OpenJDK and other Java runtimes based on the HotSpot JVM.
3840

39-
async-profiler can trace the following kinds of events:
41+
Async Profiler can trace the following kinds of events:
4042

41-
CPU cycles
42-
Hardware and Software performance counters like cache misses, branch misses, page faults, context switches etc.
43-
Allocations in Java Heap
44-
Contented lock attempts, including both Java object monitors and ReentrantLocks
43+
- CPU cycles
44+
- Allocations in Java Heap
45+
- Contented lock attempts, including both Java object monitors and ReentrantLocks
46+
- and [more](https://github.com/async-profiler/async-profiler/blob/master/docs/ProfilingModes.md)
4547

46-
For now, Java agent support this.
48+
Only Java agent support this.
4749

4850
## Out-of-process profiling
4951

docs/en/setup/backend/backend-async-profiler.md renamed to docs/en/setup/backend/backend-java-app-profiling.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1-
# Async Profiler
1+
# Java App Profiling
2+
3+
Java App Profiling uses the AsyncProfiler for sampling
24

35
Async Profiler is bound within the auto-instrument agent and corresponds to [In-Process Profiling](../../concepts-and-designs/profiling.md#in-process-profiling).
46

5-
It is passed to the proxy in the form of a task, allowing it to be enabled or disabled dynamically.
6-
When service encounters performance issues (cpu usage, memory allocation, locks), async-profiler task can be created.
7-
When the proxy receives a task, it enables Async Profiler for sampling.
8-
After sampling is completed, a flame graph will be generated for performance analysis to determine the specific business code line that caused the performance problem.
7+
It is delivered to the agent in the form of a task, allowing it to be enabled or disabled dynamically.
8+
When service encounters performance issues (cpu usage, memory allocation, locks), Async Profiler task can be created.
9+
When the agent receives a task, it enables Async Profiler for sampling.
10+
After sampling is completed, the sampling results are analyzed by requesting the server to render a flame graph for performance
11+
analysis to determine the specific business code lines that cause performance problems.
912

10-
## Activate async profiler in the OAP
13+
## Activate Async Profiler in the OAP
1114
OAP and the agent use a brand-new protocol to exchange Async Profiler data, so it is necessary to start OAP with the following configuration:
1215

1316
```yaml
1417
receiver-async-profiler:
15-
selector: ${SW_RECEIVER_ASYNC_PROFILER:default}
16-
default:
18+
selector: ${SW_RECEIVER_ASYNC_PROFILER:default}
19+
default:
20+
# Used to manage the maximum size of the jfr file that can be received, the unit is Byte, default is 30M
21+
jfrMaxSize: ${SW_RECEIVER_ASYNC_PROFILER_JFR_MAX_SIZE:31457280}
22+
# Used to determine whether to receive jfr in memory file or physical file mode
23+
#
24+
# The memory file mode have fewer local file system limitations, so they are by default. But it costs more memory.
25+
#
26+
# The physical file mode will use less memory when parsing and is more friendly to parsing large files.
27+
# However, if the storage of the tmp directory in the container is insufficient, the oap server instance may crash.
28+
# It is recommended to use physical file mode when volume mounting is used or the tmp directory has sufficient storage.
29+
memoryParserEnabled: ${SW_RECEIVER_ASYNC_PROFILER_MEMORY_PARSER_ENABLED:true}
1730
```
1831
1932
## Async Profiler Task with Analysis
@@ -45,18 +58,18 @@ When the Agent receives a Async Profiler task from OAP, it automatically generat
4558
4659
### Wait the agent to collect data and upload
4760
48-
At this point, async-profiler will trace the following kinds of events:
61+
At this point, Async Profiler will trace the events you selected when you created the task:
4962
50-
1. CPU cycles
51-
2. Hardware and Software performance counters like cache misses, branch misses, page faults, context switches etc.
52-
3. Allocations in Java Heap
53-
4. Contented lock attempts, including both Java object monitors and ReentrantLocks
63+
1. CPU,WALL,ITIMER,CTIMER: CPU cycles
64+
2. ALLOC: Allocations in Java Heap
65+
3. LOCK: Contented lock attempts, including both Java object monitors and ReentrantLocks
5466
55-
Finally, java agent will upload the jfr file produced by async-profiler to the oap server for online performance analysis.
67+
Finally, the agent will upload the jfr file produced by Async Profiler to the oap server for online performance analysis.
5668
5769
### Query the profiling task progresses
5870
59-
Wait for async-profiler to complete data collection and upload successfully,We can query the execution log of the async-profiler task and the successful and failed instances,which includes the following information:
71+
Wait for Async Profiler to complete data collection and upload successfully.
72+
We can query the execution logs of the Async Profiler task and the task status, which includes the following information:
6073
6174
1. **successInstanceIds**: SuccessInstanceIds gives instances that have executed the task successfully.
6275
2. **errorInstanceIds**: ErrorInstanceIds gives instances that failed to execute the task.

docs/menu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ catalog:
260260
path: "/en/setup/backend/backend-ebpf-profiling"
261261
- name: "Continuous Profiling"
262262
path: "/en/setup/backend/backend-continuous-profiling"
263-
- name: "Async Profiler"
264-
path: "/en/setup/backend/backend-async-profiler"
263+
- name: "Java App Profiling"
264+
path: "/en/setup/backend/backend-java-app-profiling"
265265
- name: "Event"
266266
path: "/en/concepts-and-designs/event/"
267267
- name: "Extension"

0 commit comments

Comments
 (0)