Skip to content

Commit 14f8d9f

Browse files
committed
translate profiling-karmada.md to Chinese
1 parent 59917b0 commit 14f8d9f

1 file changed

Lines changed: 27 additions & 22 deletions

File tree

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
---
2-
title: Profiling Karmada
2+
title: Karmada 性能分析
33
---
44

5-
## Enable profiling
5+
## 启用性能分析
66

7-
To profile Karmada components running inside a Kubernetes pod, set --enable-pprof flag to true in the yaml of Karmada components.
8-
The default profiling address is 127.0.0.1:6060, and it can be configured via `--profiling-bind-address`.
9-
The components which are compiled by the Karmada source code support the flag above, including `Karmada-agent`, `Karmada-aggregated-apiserver`, `Karmada-controller-manager`, `Karmada-descheduler`, `Karmada-search`, `Karmada-scheduler`, `Karmada-scheduler-estimator`, `Karmada-webhook`.
107

11-
```
12-
--enable-pprof
13-
Enable profiling via web interface host:port/debug/pprof/.
14-
--profiling-bind-address string
15-
The TCP address for serving profiling(e.g. 127.0.0.1:6060, :6060). This is only applicable if profiling is enabled. (default ":6060")
8+
若要对运行在 Kubernetes Pod 中的 Karmada 组件进行性能分析,需要在组件的 YAML 配置中将 `--enable-pprof` 参数设置为 `true`
9+
默认的分析地址为 `127.0.0.1:6060`,也可以通过 `--profiling-bind-address` 参数进行配置。
10+
11+
以下由 Karmada 源码构建的组件支持该功能:`Karmada-agent`, `Karmada-aggregated-apiserver`, `Karmada-controller-manager`, `Karmada-descheduler`, `Karmada-search`, `Karmada-scheduler`, `Karmada-scheduler-estimator`, `Karmada-webhook`.
1612

1713
```
14+
--enable-pprof
15+
通过 Web 接口 host:port/debug/pprof/ 启用性能分析。
16+
--profiling-bind-address string
17+
用于提供性能分析服务的 TCP 地址(如 127.0.0.1:6060、:6060)。仅在启用分析时有效,默认值为 ":6060"。
18+
```
1819

19-
## Expose the endpoint at the local port
20+
## 通过本地端口暴露分析接口
2021

21-
You can get at the application in the pod by port forwarding with kubectl, for example:
22+
你可以通过 `kubectl port-forward` 命令将 Pod 中的分析端口转发到本地,例如:
2223

2324
```shell
2425
$ kubectl -n karmada-system get pod
@@ -33,31 +34,35 @@ Forwarding from 127.0.0.1:6060 -> 6060
3334
Forwarding from [::1]:6060 -> 6060
3435
```
3536

36-
The HTTP endpoint will now be available as a local port.
37+
此时,HTTP 分析接口将可通过本地端口访问。
38+
3739

38-
## Generate the data
40+
## 生成分析数据
3941

40-
You can then generate the file for the memory profile with curl and pipe the data to a file:
42+
你可以通过 `curl` 命令获取内存分析数据(heap profile)并保存到文件:
4143

4244
```shell
43-
curl http://localhost:6060/debug/pprof/heap > heap.pprof
45+
curl http://localhost:6060/debug/pprof/heap > heap.pprof
4446
```
4547

46-
Generate the file for the CPU profile with curl and pipe the data to a file (7200 seconds is two hours):
48+
获取 CPU 分析数据并保存(以下示例持续时间为 7200 秒,即两小时):
4749

4850
```shell
4951
curl "http://localhost:6060/debug/pprof/profile?seconds=7200" > cpu.pprof
5052
```
5153

52-
## Analyze the data
5354

54-
To analyze the data:
55+
## 分析数据
56+
57+
使用 Go 的 `pprof` 工具分析生成的数据文件:
5558

5659
```shell
60+
5761
go tool pprof heap.pprof
5862
```
5963

60-
## Read more about profiling
6164

62-
1. [Profiling Golang Programs on Kubernetes](https://danlimerick.wordpress.com/2017/01/24/profiling-golang-programs-on-kubernetes/)
63-
2. [Official Go blog](https://blog.golang.org/pprof)
65+
## 深入阅读性能分析相关内容
66+
67+
1. [在 Kubernetes 上分析 Golang 程序性能](https://danlimerick.wordpress.com/2017/01/24/profiling-golang-programs-on-kubernetes/)
68+
2. [Go 官方博客](https://blog.golang.org/pprof)

0 commit comments

Comments
 (0)