mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-13 06:42:48 +00:00
update doc
This commit is contained in:
1 parent
5ccb3e21a4
commit
c1dcc8ff9e
12 files changed
+397
-4
No files matched your search
@@ -1,6 +1,61 @@
|
||||
Docker
|
||||
===
|
||||
|
||||
|
||||
## Use JDK in Docker
|
||||
|
||||
Many times, the problem that arthas can't work with the application in docker is because the docker does not install JDK, but installs JRE. If only JRE is installed, many JAVA command line tools and class libraries will be missing, and Arthas will not work properly. Here are two common ways to use JDK in Docker.
|
||||
|
||||
### Use public JDK image
|
||||
|
||||
* https://hub.docker.com/_/openjdk/
|
||||
|
||||
such as:
|
||||
|
||||
```
|
||||
FROM openjdk:8-jdk
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```
|
||||
FROM openjdk:8-jdk-alpine
|
||||
```
|
||||
|
||||
### Install via package management software
|
||||
|
||||
such as:
|
||||
|
||||
```bash
|
||||
# Install OpenJDK-8
|
||||
RUN apt-get update && \
|
||||
apt-get install -y openjdk-8-jdk && \
|
||||
apt-get install -y ant && \
|
||||
apt-get clean;
|
||||
|
||||
# Fix certificate issues
|
||||
RUN apt-get update && \
|
||||
apt-get install ca-certificates-java && \
|
||||
apt-get clean && \
|
||||
update-ca-certificates -f;
|
||||
|
||||
# Setup JAVA_HOME - useful for docker commandline
|
||||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
|
||||
RUN export JAVA_HOME
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```bash
|
||||
RUN yum install -y \
|
||||
java-1.8.0-openjdk \
|
||||
java-1.8.0-openjdk-devel
|
||||
|
||||
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk/
|
||||
RUN export JAVA_HOME
|
||||
```
|
||||
|
||||
|
||||
## Quick start with Docker
|
||||
|
||||
1. Delete the existing `arthas-demo` docker container (not necessary)
|
||||
|
||||
@@ -181,3 +181,49 @@ $ profiler version
|
||||
Async-profiler 1.6 built on Sep 9 2019
|
||||
Copyright 2019 Andrei Pangin
|
||||
```
|
||||
|
||||
### Configure framebuf option
|
||||
|
||||
> If you encounter `[frame_buffer_overflow]` in the generated svg image, you need to increase the framebuf (the default value is 1'000'000), which can be configured explicitly, such as:
|
||||
|
||||
```bash
|
||||
profiler start --framebuf 5000000
|
||||
```
|
||||
|
||||
### Configure include/exclude to filter data
|
||||
|
||||
If the application is complex and generates a lot of content, and you want to focus on only part of the data, you can filter by include/exclude. such as
|
||||
|
||||
```bash
|
||||
profiler start --include'java/*' --include'demo/*' --exclude'*Unsafe.park*'
|
||||
```
|
||||
|
||||
> Both include/exclude support setting multiple values, but need to be configured at the end of the command line.
|
||||
|
||||
|
||||
### Specify execution time
|
||||
|
||||
For example, if you want the profiler to automatically end after 300 seconds, you can specify it with the `-d`/`--duration` parameter:
|
||||
|
||||
```bash
|
||||
profiler start --duration 300
|
||||
```
|
||||
|
||||
### Generate jfr format result
|
||||
|
||||
> Note that jfr only supports configuration at `start`. If it is specified at `stop`, it will not take effect.
|
||||
|
||||
```
|
||||
profiler start --file /tmp/test.jfr
|
||||
```
|
||||
|
||||
The `file` parameter supports some variables:
|
||||
|
||||
* Timestamp: `--file /tmp/test-%t.jfr`
|
||||
* Process ID: `--file /tmp/test-%p.jfr`
|
||||
|
||||
|
||||
The generated results can be viewed with tools that support the jfr format. such as:
|
||||
|
||||
* JDK Mission Control: https://github.com/openjdk/jmc
|
||||
* JProfiler: https://github.com/alibaba/arthas/issues/1416
|
||||
Reference in new issue
Block a user