From 9d48991778756a530745591527c71e2124252d16 Mon Sep 17 00:00:00 2001 From: ADD-SP Date: Sat, 3 Apr 2021 16:32:44 +0800 Subject: [PATCH] :memo: Update docs. --- docs/advance/syntax.md | 18 ++++++++++++++---- docs/zh-cn/advance/syntax.md | 10 ++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/advance/syntax.md b/docs/advance/syntax.md index 6a268e54..04a1a9ef 100644 --- a/docs/advance/syntax.md +++ b/docs/advance/syntax.md @@ -101,22 +101,32 @@ Set the parameters related to CC protection. * `buffer_size`: used to set the size of the memory for recording IP accesses, such as `10m`, `10240k`, must not be less than `10m`, if not specified then the default is `10m`. -## `waf_cache_size` +## `waf_cache` -* syntax: `waf_cache_size [interval] [percent];` +* syntax: `waf_cache [interval] [percent];` * default: —— * context: server Set parameters related to caching rule inspection results. * `capacity`: For some inspections with the caching mechanism enabled, the maximum number of inspection results for each inspection target is cached. -* `interval`: Sets the period of the batch cache phase-out in minutes. If not specified, the default is `60`, which is 60 minutes. +* `interval`: Used to set the period of batch cache cleaning in minutes. If not specified, the default is `60`, which is 60 minutes. * `percent`: what percentage of the cache will be eliminated each time the cache is eliminated in bulk. You need to specify an integer greater than 0 and less than or equal to 100. A setting of 50 means that half of the cache is eliminated. If not specified, the default is `50`. ::: tip Cache-enabled inspections -Cache-enabled inspections refer to all inspections except CC protection, IP black and white list inspection, and POST inspection. +Cache-enabled inspections refer to all inspections except CC protection, I +P black and white list inspection, and POST inspection. + +::: + + +::: tip Performance optimization suggestions + +Too small a `capacity` will result in frequent cache cleanups, +increasing memory fragmentation and reducing performance. +So please set it reasonably according to your actual needs. ::: diff --git a/docs/zh-cn/advance/syntax.md b/docs/zh-cn/advance/syntax.md index ca9336b7..26b3bb9c 100644 --- a/docs/zh-cn/advance/syntax.md +++ b/docs/zh-cn/advance/syntax.md @@ -100,9 +100,9 @@ waf_mode STD !UA; * `duration`:表示超出第一个参数 `rate` 的限制后拉黑 IP 多少分钟(大于零的整数). * `buffer_size`:用于设置记录 IP 访问次数的内存的大小,如 `10m`、`10240k`,不得小于 `10m`,如不指定则默认为 `10m`。 -## `waf_cache_size` +## `waf_cache` -* 配置语法: `waf_cache_size [interval] [percent];` +* 配置语法: `waf_cache [interval] [percent];` * 默认配置:—— * 配置段: server @@ -118,6 +118,12 @@ waf_mode STD !UA; ::: +::: tip 性能优化建议 + +`capacity` 过小会导致频繁地淘汰缓存,增加内存碎片,降低性能。所以请根据实际应用场景合理地设置。 + +::: + ::: warning 警告 本配置属于开发版新增的功能,只能在开发版中使用,等稳定后会合并到稳定版中。