# 调整 block-cache 参数配置

+ 在线调整（实验性功能）
+ 确认调整是否生效

```
set config tikv storage.block-cache.capacity='8155MB';
Query OK, 0 rows affected (0.02 sec)

show config where name ='storage.block-cache.capacity';
+------+-----------------------+----------------------------------------+-------------+
| Type | Instance              | Name                                   | Value       |
+------+-----------------------+----------------------------------------+-------------+
| tikv | 172.x.x.x:20181       | storage.block-cache.capacity           | 8155MiB     |
+------+-----------------------+----------------------------------------+-------------+
1 row in set (0.01 sec)
```
-------------------------------------------------------------
如果确认是因 block-cache 设置不合理导致的 OOM ，那么可以通过调整对应参数来缓解。
自 v4.0 版本开始，支持在线配置集群参数，该变更主要是通过利用 SQL 对包括 TiDB、TiKV 以及 PD 在内的各组件的部分配置参数进行在线更新。我们可以通过在线配置变更对各组件进行性能调优而无需重启集群组件。在线调整 block-cache 配置，可使用下面的方法：
set config tikv storage.block-cache.capacity='8155MB';
Query OK, 0 rows affected (0.02 sec)

调整完成后，确认调整是否生效：
```
show config where name ='storage.block-cache.capacity';
+------+--------------------+------------------------------+---------+
| Type | Instance | Name | Value |
+------+--------------------+------------------------------+---------+
| tikv | 172.x.x.x:20181 | storage.block-cache.capacity | 8155MiB |
+------+--------------------+------------------------------+---------+
1 row in set (0.01 sec)
```



