This is an automated email from the ASF dual-hosted git repository. azagrebin pushed a commit to branch release-1.10 in repository https://gitbox.apache.org/repos/asf/flink.git
commit dfd82556c407c2da51f24f606217a2c9366a6c28 Author: Andrey Zagrebin <azagre...@apache.org> AuthorDate: Fri Jan 31 13:45:14 2020 +0100 [FLINK-15143][docs] Add tuning and troubleshooting guides for memory configuration --- docs/ops/deployment/cluster_setup.md | 2 +- docs/ops/deployment/cluster_setup.zh.md | 2 +- docs/ops/memory/mem_setup.md | 4 +- docs/ops/memory/mem_trouble.md | 74 ++++++++++++++++++++++++++++ docs/ops/memory/mem_trouble.zh.md | 74 ++++++++++++++++++++++++++++ docs/ops/memory/mem_tuning.md | 87 +++++++++++++++++++++++++++++++++ docs/ops/memory/mem_tuning.zh.md | 87 +++++++++++++++++++++++++++++++++ docs/ops/state/state_backends.md | 7 +++ docs/ops/state/state_backends.zh.md | 5 ++ 9 files changed, 338 insertions(+), 4 deletions(-) diff --git a/docs/ops/deployment/cluster_setup.md b/docs/ops/deployment/cluster_setup.md index 2fda08c..4f12111 100644 --- a/docs/ops/deployment/cluster_setup.md +++ b/docs/ops/deployment/cluster_setup.md @@ -107,7 +107,7 @@ Please see the [configuration page](../config.html) for details and additional c In particular, * the amount of available memory per JobManager (`jobmanager.heap.size`), - * the amount of available memory per TaskManager (`taskmanager.memory.process.size`), + * the amount of available memory per TaskManager (`taskmanager.memory.process.size` and check [memory setup guide](../memory/mem_tuning.html#configure-memory-for-standalone-deployment)), * the number of available CPUs per machine (`taskmanager.numberOfTaskSlots`), * the total number of CPUs in the cluster (`parallelism.default`) and * the temporary directories (`io.tmp.dirs`) diff --git a/docs/ops/deployment/cluster_setup.zh.md b/docs/ops/deployment/cluster_setup.zh.md index 4bd474f..ef8f3e8 100644 --- a/docs/ops/deployment/cluster_setup.zh.md +++ b/docs/ops/deployment/cluster_setup.zh.md @@ -107,7 +107,7 @@ Please see the [configuration page](../config.html) for details and additional c In particular, * the amount of available memory per JobManager (`jobmanager.heap.size`), - * the amount of available memory per TaskManager (`taskmanager.memory.process.size`), + * the amount of available memory per TaskManager (`taskmanager.memory.process.size` and check [memory setup guide](../memory/mem_tuning.html#configure-memory-for-standalone-deployment)), * the number of available CPUs per machine (`taskmanager.numberOfTaskSlots`), * the total number of CPUs in the cluster (`parallelism.default`) and * the temporary directories (`io.tmp.dirs`) diff --git a/docs/ops/memory/mem_setup.md b/docs/ops/memory/mem_setup.md index 4b2786f..f2a2b06 100644 --- a/docs/ops/memory/mem_setup.md +++ b/docs/ops/memory/mem_setup.md @@ -62,7 +62,7 @@ and *direct memory*. If you configure *total process memory* you declare how much memory in total should be assigned to the Flink *JVM process*. For the containerized deployments it corresponds to the size of the requested container, see also -[how to configure memory for containers](#heading=h.q0nx4u2c3pzx) +[how to configure memory for containers](mem_tuning.html#configure-memory-for-containers) ([Kubernetes](../deployment/kubernetes.html), [Yarn](../deployment/yarn_setup.html) or [Mesos](../deployment/mesos.html)). Another way to setup the memory is to set [task heap](#task-operator-heap-memory) and [managed memory](#managed-memory) @@ -110,7 +110,7 @@ The size of *managed memory* can be *Size* will override *fraction*, if both are set. If neither *size* nor *fraction* is explicitly configured, the [default fraction](../config.html#taskmanager-memory-managed-fraction) will be used. -See also [how to configure memory for state backends](#heading=h.srelwz7nbzwa) and [batch jobs](#heading=h.d6mjc9yd85c0). +See also [how to configure memory for state backends](mem_tuning.html#configure-memory-for-state-backends) and [batch jobs](mem_tuning.html#configure-memory-for-batch-jobs). ## Configure Off-Heap Memory (direct or native) diff --git a/docs/ops/memory/mem_trouble.md b/docs/ops/memory/mem_trouble.md new file mode 100644 index 0000000..cd6463b --- /dev/null +++ b/docs/ops/memory/mem_trouble.md @@ -0,0 +1,74 @@ +--- +title: "Troubleshooting" +nav-parent_id: ops_mem +nav-pos: 4 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +* toc +{:toc} + +## IllegalConfigurationException + +If you see an *IllegalConfigurationException* thrown from *TaskExecutorProcessUtils*, it usually indicates +that there is either an invalid configuration value (e.g. negative memory size, fraction that is greater than 1, etc.) +or configuration conflicts. Check the documentation chapters related to the [memory components](mem_setup.html#detailed-memory-model) +mentioned in the exception message. + +## OutOfMemoryError: Java heap space + +The exception usually indicates that the JVM heap is too small. You can try to increase the JVM heap size +by increasing [total memory](mem_setup.html#configure-total-memory) or [task heap memory](mem_setup.html#task-operator-heap-memory). + +<span class="label label-info">Note</span> You can also increase the [framework heap memory](mem_detail.html#framework-memory) but this option +is advanced and should only be changed if you are sure that the Flink framework itself needs more memory. + +## OutOfMemoryError: Direct buffer memory + +The exception usually indicates that the JVM *direct memory* limit is too small or that there is a *direct memory leak*. +Check whether user code or other external dependencies use the JVM *direct memory* and that it is properly accounted for. +You can try to increase its limit by adjusting [direct off-heap memory](mem_setup.html#detailed-memory-model). +See also [how to configure off-heap memory](mem_setup.html#configure-off-heap-memory-direct-or-native) and +the [JVM arguments](mem_detail.html#jvm-parameters) which Flink sets. + +## OutOfMemoryError: Metaspace + +The exception usually indicates that [JVM metaspace limit](mem_detail.html#jvm-parameters) is configured too small. +You can try to increase the [JVM metaspace option](../config.html#taskmanager-memory-jvm-metaspace-size). + +## IOException: Insufficient number of network buffers + +The exception usually indicates that the size of the configured [network memory](mem_setup.html#detailed-memory-model) +is not big enough. You can try to increase the *network memory* by adjusting the following options: +* [`taskmanager.memory.network.min`](../config.html#taskmanager-memory-network-min) +* [`taskmanager.memory.network.max`](../config.html#taskmanager-memory-network-max) +* [`taskmanager.memory.network.fraction`](../config.html#taskmanager-memory-network-fraction) + +## Container Memory Exceeded + +If a task executor container tries to allocate memory beyond its requested size (Yarn, Mesos or Kubernetes), +this usually indicates that Flink has not reserved enough native memory. You can observe this either by using an external +monitoring system or from the error messages when a container gets killed by the deployment environment. + +If [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend) is used and the memory controlling is disabled, +you can try to increase the [managed memory](mem_setup.html#managed-memory). + +Alternatively, you can increase the [JVM overhead](mem_setup.html#detailed-memory-model). +See also [how to configure memory for containers](mem_tuning.html#configure-memory-for-containers). diff --git a/docs/ops/memory/mem_trouble.zh.md b/docs/ops/memory/mem_trouble.zh.md new file mode 100644 index 0000000..cd6463b --- /dev/null +++ b/docs/ops/memory/mem_trouble.zh.md @@ -0,0 +1,74 @@ +--- +title: "Troubleshooting" +nav-parent_id: ops_mem +nav-pos: 4 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +* toc +{:toc} + +## IllegalConfigurationException + +If you see an *IllegalConfigurationException* thrown from *TaskExecutorProcessUtils*, it usually indicates +that there is either an invalid configuration value (e.g. negative memory size, fraction that is greater than 1, etc.) +or configuration conflicts. Check the documentation chapters related to the [memory components](mem_setup.html#detailed-memory-model) +mentioned in the exception message. + +## OutOfMemoryError: Java heap space + +The exception usually indicates that the JVM heap is too small. You can try to increase the JVM heap size +by increasing [total memory](mem_setup.html#configure-total-memory) or [task heap memory](mem_setup.html#task-operator-heap-memory). + +<span class="label label-info">Note</span> You can also increase the [framework heap memory](mem_detail.html#framework-memory) but this option +is advanced and should only be changed if you are sure that the Flink framework itself needs more memory. + +## OutOfMemoryError: Direct buffer memory + +The exception usually indicates that the JVM *direct memory* limit is too small or that there is a *direct memory leak*. +Check whether user code or other external dependencies use the JVM *direct memory* and that it is properly accounted for. +You can try to increase its limit by adjusting [direct off-heap memory](mem_setup.html#detailed-memory-model). +See also [how to configure off-heap memory](mem_setup.html#configure-off-heap-memory-direct-or-native) and +the [JVM arguments](mem_detail.html#jvm-parameters) which Flink sets. + +## OutOfMemoryError: Metaspace + +The exception usually indicates that [JVM metaspace limit](mem_detail.html#jvm-parameters) is configured too small. +You can try to increase the [JVM metaspace option](../config.html#taskmanager-memory-jvm-metaspace-size). + +## IOException: Insufficient number of network buffers + +The exception usually indicates that the size of the configured [network memory](mem_setup.html#detailed-memory-model) +is not big enough. You can try to increase the *network memory* by adjusting the following options: +* [`taskmanager.memory.network.min`](../config.html#taskmanager-memory-network-min) +* [`taskmanager.memory.network.max`](../config.html#taskmanager-memory-network-max) +* [`taskmanager.memory.network.fraction`](../config.html#taskmanager-memory-network-fraction) + +## Container Memory Exceeded + +If a task executor container tries to allocate memory beyond its requested size (Yarn, Mesos or Kubernetes), +this usually indicates that Flink has not reserved enough native memory. You can observe this either by using an external +monitoring system or from the error messages when a container gets killed by the deployment environment. + +If [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend) is used and the memory controlling is disabled, +you can try to increase the [managed memory](mem_setup.html#managed-memory). + +Alternatively, you can increase the [JVM overhead](mem_setup.html#detailed-memory-model). +See also [how to configure memory for containers](mem_tuning.html#configure-memory-for-containers). diff --git a/docs/ops/memory/mem_tuning.md b/docs/ops/memory/mem_tuning.md new file mode 100644 index 0000000..9d83d00 --- /dev/null +++ b/docs/ops/memory/mem_tuning.md @@ -0,0 +1,87 @@ +--- +title: "Memory tuning guide" +nav-parent_id: ops_mem +nav-pos: 3 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +In addition to the [main memory setup guide](mem_setup.html), this section explains how to setup memory of task executors +depending on the use case and which options are important in which case. + +* toc +{:toc} + +## Configure memory for standalone deployment + +It is recommended to configure [total Flink memory](mem_setup.html#configure-total-memory) +([`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size)) or its [components](mem_setup.html#detailed-memory-model) +for [standalone deployment](../deployment/cluster_setup.html) where you want to declare how much memory is given to Flink itself. +Additionally, you can adjust *JVM metaspace* if it causes [problems](mem_trouble.html#outofmemoryerror-metaspace). + +The *total Process memory* is not relevant because *JVM overhead* is not controlled by Flink or deployment environment, +only physical resources of the executing machine matter in this case. + +## Configure memory for containers + +It is recommended to configure [total process memory](mem_setup.html#configure-total-memory) +([`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size)) for the containerized deployments +([Kubernetes](../deployment/kubernetes.html), [Yarn](../deployment/yarn_setup.html) or [Mesos](../deployment/mesos.html)). +It declares how much memory in total should be assigned to the Flink *JVM process* and corresponds to the size of the requested container. + +<span class="label label-info">Note</span> If you configure the *total Flink memory* Flink will implicitly add JVM memory components +to derive the *total process memory* and request a container with the memory of that derived size, +see also [detailed Memory Model](mem_setup.html#detailed-memory-model). + +<div class="alert alert-warning"> + <strong>Warning:</strong> If Flink or user code allocates unmanaged off-heap (native) memory beyond the container size + the job can fail because the deployment environment can kill the offending containers. +</div> +See also description of [container memory exceeded](mem_trouble.html#container-memory-exceeded) failure. + +## Configure memory for state backends + +When deploying a Flink streaming application, the type of [state backend](../state/state_backends.html) used +will dictate the optimal memory configurations of your cluster. + +### Heap state backend + +When running a stateless job or using a heap state backend ([MemoryStateBackend](../state/state_backends.html#the-memorystatebackend) +or [FsStateBackend](../state/state_backends.html#the-fsstatebackend), set [managed memory](mem_setup.html#managed-memory) to zero. +This will ensure that the maximum amount of memory is allocated for user code on the JVM. + +### RocksDB state backend + +The [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend) uses native memory. By default, +RocksDB is setup to limit native memory allocation to the size of the [managed memory](mem_setup.html#managed-memory). +Therefore, it is important to reserve enough *managed memory* for your state use case. If you disable the default RocksDB memory control, +task executors can be killed in containerized deployments if RocksDB allocates memory above the limit of the requested container size +(the [total process memory](mem_setup.html#configure-total-memory)). +See also [how to tune RocksDB memory](../state/large_state_tuning.html#tuning-rocksdb-memory) +and [state.backend.rocksdb.memory.managed](../config.html#state-backend-rocksdb-memory-managed). + +## Configure memory for batch jobs + +Flink's batch operators leverage [managed memory](../memory/mem_setup.html#managed-memory) to run more efficiently. +In doing so, some operations can be performed directly on raw data without having to be deserialized into Java objects. +This means that [managed memory](../memory/mem_setup.html#managed-memory) configurations have practical effects +on the performance of your applications. Flink will attempt to allocate and use as much [managed memory](../memory/mem_setup.html#managed-memory) +as configured for batch jobs but not go beyond its limits. This prevents `OutOfMemoryError`'s because Flink knows precisely +how much memory it has to leverage. If the [managed memory](../memory/mem_setup.html#managed-memory) is not sufficient, +Flink will gracefully spill to disk. diff --git a/docs/ops/memory/mem_tuning.zh.md b/docs/ops/memory/mem_tuning.zh.md new file mode 100644 index 0000000..9d83d00 --- /dev/null +++ b/docs/ops/memory/mem_tuning.zh.md @@ -0,0 +1,87 @@ +--- +title: "Memory tuning guide" +nav-parent_id: ops_mem +nav-pos: 3 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +In addition to the [main memory setup guide](mem_setup.html), this section explains how to setup memory of task executors +depending on the use case and which options are important in which case. + +* toc +{:toc} + +## Configure memory for standalone deployment + +It is recommended to configure [total Flink memory](mem_setup.html#configure-total-memory) +([`taskmanager.memory.flink.size`](../config.html#taskmanager-memory-flink-size)) or its [components](mem_setup.html#detailed-memory-model) +for [standalone deployment](../deployment/cluster_setup.html) where you want to declare how much memory is given to Flink itself. +Additionally, you can adjust *JVM metaspace* if it causes [problems](mem_trouble.html#outofmemoryerror-metaspace). + +The *total Process memory* is not relevant because *JVM overhead* is not controlled by Flink or deployment environment, +only physical resources of the executing machine matter in this case. + +## Configure memory for containers + +It is recommended to configure [total process memory](mem_setup.html#configure-total-memory) +([`taskmanager.memory.process.size`](../config.html#taskmanager-memory-process-size)) for the containerized deployments +([Kubernetes](../deployment/kubernetes.html), [Yarn](../deployment/yarn_setup.html) or [Mesos](../deployment/mesos.html)). +It declares how much memory in total should be assigned to the Flink *JVM process* and corresponds to the size of the requested container. + +<span class="label label-info">Note</span> If you configure the *total Flink memory* Flink will implicitly add JVM memory components +to derive the *total process memory* and request a container with the memory of that derived size, +see also [detailed Memory Model](mem_setup.html#detailed-memory-model). + +<div class="alert alert-warning"> + <strong>Warning:</strong> If Flink or user code allocates unmanaged off-heap (native) memory beyond the container size + the job can fail because the deployment environment can kill the offending containers. +</div> +See also description of [container memory exceeded](mem_trouble.html#container-memory-exceeded) failure. + +## Configure memory for state backends + +When deploying a Flink streaming application, the type of [state backend](../state/state_backends.html) used +will dictate the optimal memory configurations of your cluster. + +### Heap state backend + +When running a stateless job or using a heap state backend ([MemoryStateBackend](../state/state_backends.html#the-memorystatebackend) +or [FsStateBackend](../state/state_backends.html#the-fsstatebackend), set [managed memory](mem_setup.html#managed-memory) to zero. +This will ensure that the maximum amount of memory is allocated for user code on the JVM. + +### RocksDB state backend + +The [RocksDBStateBackend](../state/state_backends.html#the-rocksdbstatebackend) uses native memory. By default, +RocksDB is setup to limit native memory allocation to the size of the [managed memory](mem_setup.html#managed-memory). +Therefore, it is important to reserve enough *managed memory* for your state use case. If you disable the default RocksDB memory control, +task executors can be killed in containerized deployments if RocksDB allocates memory above the limit of the requested container size +(the [total process memory](mem_setup.html#configure-total-memory)). +See also [how to tune RocksDB memory](../state/large_state_tuning.html#tuning-rocksdb-memory) +and [state.backend.rocksdb.memory.managed](../config.html#state-backend-rocksdb-memory-managed). + +## Configure memory for batch jobs + +Flink's batch operators leverage [managed memory](../memory/mem_setup.html#managed-memory) to run more efficiently. +In doing so, some operations can be performed directly on raw data without having to be deserialized into Java objects. +This means that [managed memory](../memory/mem_setup.html#managed-memory) configurations have practical effects +on the performance of your applications. Flink will attempt to allocate and use as much [managed memory](../memory/mem_setup.html#managed-memory) +as configured for batch jobs but not go beyond its limits. This prevents `OutOfMemoryError`'s because Flink knows precisely +how much memory it has to leverage. If the [managed memory](../memory/mem_setup.html#managed-memory) is not sufficient, +Flink will gracefully spill to disk. diff --git a/docs/ops/state/state_backends.md b/docs/ops/state/state_backends.md index 5bc0afb..134621b 100644 --- a/docs/ops/state/state_backends.md +++ b/docs/ops/state/state_backends.md @@ -74,6 +74,8 @@ The MemoryStateBackend is encouraged for: - Local development and debugging - Jobs that do hold little state, such as jobs that consist only of record-at-a-time functions (Map, FlatMap, Filter, ...). The Kafka Consumer requires very little state. +It is also recommended to set [managed memory](../memory/mem_setup.html#managed-memory) to zero. +This will ensure that the maximum amount of memory is allocated for user code on the JVM. ### The FsStateBackend @@ -92,6 +94,9 @@ The FsStateBackend is encouraged for: - Jobs with large state, long windows, large key/value states. - All high-availability setups. +It is also recommended to set [managed memory](../memory/mem_setup.html#managed-memory) to zero. +This will ensure that the maximum amount of memory is allocated for user code on the JVM. + ### The RocksDBStateBackend The *RocksDBStateBackend* is configured with a file system URL (type, address, path), such as "hdfs://namenode:40010/flink/checkpoints" or "file:///data/flink/checkpoints". @@ -119,6 +124,8 @@ This also means, however, that the maximum throughput that can be achieved will this state backend. All reads/writes from/to this backend have to go through de-/serialization to retrieve/store the state objects, which is also more expensive than always working with the on-heap representation as the heap-based backends are doing. +Check also recommendations about the [task executor memory configuration](../memory/mem_tuning.html#rocksdb-state-backend) for the RocksDBStateBackend. + RocksDBStateBackend is currently the only backend that offers incremental checkpoints (see [here](large_state_tuning.html)). Certain RocksDB native metrics are available but disabled by default, you can find full documentation [here]({{ site.baseurl }}/ops/config.html#rocksdb-native-metrics) diff --git a/docs/ops/state/state_backends.zh.md b/docs/ops/state/state_backends.zh.md index 60718c2..57feabd 100644 --- a/docs/ops/state/state_backends.zh.md +++ b/docs/ops/state/state_backends.zh.md @@ -71,6 +71,7 @@ MemoryStateBackend 适用场景: - 本地开发和调试。 - 状态很小的 Job,例如:由每次只处理一条记录的函数(Map、FlatMap、Filter 等)构成的 Job。Kafka Consumer 仅仅需要非常小的状态。 +建议同时将 [managed memory](../memory/mem_setup.html#managed-memory) 设为0,以保证将最大限度的内存分配给 JVM 上的用户代码。 ### FsStateBackend @@ -91,6 +92,8 @@ FsStateBackend 适用场景: - 状态比较大、窗口比较长、key/value 状态比较大的 Job。 - 所有高可用的场景。 +建议同时将 [managed memory](../memory/mem_setup.html#managed-memory) 设为0,以保证将最大限度的内存分配给 JVM 上的用户代码。 + ### RocksDBStateBackend *RocksDBStateBackend* 需要配置一个文件系统的 URL (类型、地址、路径),例如:"hdfs://namenode:40010/flink/checkpoints" 或 "file:///data/flink/checkpoints"。 @@ -115,6 +118,8 @@ RocksDBStateBackend 的适用场景: 然而,这也意味着使用 RocksDBStateBackend 将会使应用程序的最大吞吐量降低。 所有的读写都必须序列化、反序列化操作,这个比基于堆内存的 state backend 的效率要低很多。 +请同时参考 [Task Executor 内存配置](../memory/mem_tuning.html#rocksdb-state-backend) 中关于 RocksDBStateBackend 的建议。 + RocksDBStateBackend 是目前唯一支持增量 CheckPoint 的 State Backend (见 [这里](large_state_tuning.html))。 可以使用一些 RocksDB 的本地指标(metrics),但默认是关闭的。你能在 [这里]({{ site.baseurl }}/zh/ops/config.html#rocksdb-native-metrics) 找到关于 RocksDB 本地指标的文档。