From 22c3b3f3497bbff7039abaad3cca28305f277ecc Mon Sep 17 00:00:00 2001 From: "H. Shay" Date: Tue, 17 May 2022 17:50:29 -0700 Subject: [PATCH 1/5] fix autotune documentation --- docs/usage/configuration/config_documentation.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 3e2031f08aa6..b3df11c47af6 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1122,14 +1122,18 @@ Caching can be configured through the following sub-options: * `cache_autotuning` and its sub-options `max_cache_memory_usage`, `target_cache_memory_usage`, and `min_cache_ttl` work in conjunction with each other to maintain a balance between cache memory usage and cache entry availability. You must be using [jemalloc](https://github.com/matrix-org/synapse#help-synapse-is-slow-and-eats-all-my-ramcpu) - to utilize this option, and all three of the options must be specified for this feature to work. + to utilize this option, and all three of the options must be specified for this feature to work. This option + defaults to off, enable it by providing values for the sub-options listed below. Please note that the feature will not work + and may cause unstable behavior (such as excessive empyting of caches) if all of the values are not provided. + When providing values for memory usage use M for MB and K for KB. * `max_cache_memory_usage` sets a ceiling on how much memory the cache can use before caches begin to be continuously evicted. They will continue to be evicted until the memory usage drops below the `target_memory_usage`, set in - the flag below, or until the `min_cache_ttl` is hit. - * `target_memory_usage` sets a rough target for the desired memory usage of the caches. + the setting below, or until the `min_cache_ttl` is hit. There is no default value for this option. + * `target_memory_usage` sets a rough target for the desired memory usage of the caches. There is no default value + for this option. * `min_cache_ttl` sets a limit under which newer cache entries are not evicted and is only applied when caches are actively being evicted/`max_cache_memory_usage` has been exceeded. This is to protect hot caches - from being emptied while Synapse is evicting due to memory. + from being emptied while Synapse is evicting due to memory. There is no default for this option. Example configuration: ```yaml From 23684782218461c977987aecd720a47879b8c980 Mon Sep 17 00:00:00 2001 From: "H. Shay" Date: Tue, 17 May 2022 17:53:34 -0700 Subject: [PATCH 2/5] newsfragment --- changelog.d/12776.doc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog.d/12776.doc diff --git a/changelog.d/12776.doc b/changelog.d/12776.doc new file mode 100644 index 000000000000..a02fdc791fae --- /dev/null +++ b/changelog.d/12776.doc @@ -0,0 +1,2 @@ +Add info to documentation of config option `cache_autotuning`. + From 8a31f33fd60304eef3c1645e5feb50f93a45f4ed Mon Sep 17 00:00:00 2001 From: "H. Shay" Date: Wed, 18 May 2022 09:34:17 -0700 Subject: [PATCH 3/5] requested changes --- changelog.d/12776.doc | 2 +- docs/usage/configuration/config_documentation.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog.d/12776.doc b/changelog.d/12776.doc index a02fdc791fae..c00489a8ce14 100644 --- a/changelog.d/12776.doc +++ b/changelog.d/12776.doc @@ -1,2 +1,2 @@ -Add info to documentation of config option `cache_autotuning`. +Add additional info to documentation of config option `cache_autotuning`. diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index b3df11c47af6..f7d7b3954eec 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1124,8 +1124,8 @@ Caching can be configured through the following sub-options: usage and cache entry availability. You must be using [jemalloc](https://github.com/matrix-org/synapse#help-synapse-is-slow-and-eats-all-my-ramcpu) to utilize this option, and all three of the options must be specified for this feature to work. This option defaults to off, enable it by providing values for the sub-options listed below. Please note that the feature will not work - and may cause unstable behavior (such as excessive empyting of caches) if all of the values are not provided. - When providing values for memory usage use M for MB and K for KB. + and may cause unstable behavior (such as excessive emptying of caches or exceptions) if all of the values are not provided. + When providing values for memory usage use M for MiB and K for KiB (see [Config Conventions](#config-conventions). * `max_cache_memory_usage` sets a ceiling on how much memory the cache can use before caches begin to be continuously evicted. They will continue to be evicted until the memory usage drops below the `target_memory_usage`, set in the setting below, or until the `min_cache_ttl` is hit. There is no default value for this option. @@ -1133,7 +1133,7 @@ Caching can be configured through the following sub-options: for this option. * `min_cache_ttl` sets a limit under which newer cache entries are not evicted and is only applied when caches are actively being evicted/`max_cache_memory_usage` has been exceeded. This is to protect hot caches - from being emptied while Synapse is evicting due to memory. There is no default for this option. + from being emptied while Synapse is evicting due to memory. There is no default value for this option. Example configuration: ```yaml From 37464ade641e9fd69eabc467d46134bf1e97965c Mon Sep 17 00:00:00 2001 From: "H. Shay" Date: Wed, 18 May 2022 09:53:29 -0700 Subject: [PATCH 4/5] update memory size instructions --- docs/usage/configuration/config_documentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index f7d7b3954eec..76b96aef511a 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1125,7 +1125,7 @@ Caching can be configured through the following sub-options: to utilize this option, and all three of the options must be specified for this feature to work. This option defaults to off, enable it by providing values for the sub-options listed below. Please note that the feature will not work and may cause unstable behavior (such as excessive emptying of caches or exceptions) if all of the values are not provided. - When providing values for memory usage use M for MiB and K for KiB (see [Config Conventions](#config-conventions). + Please see the [Config Conventions](#config-conventions) for information on how to specify memory size. * `max_cache_memory_usage` sets a ceiling on how much memory the cache can use before caches begin to be continuously evicted. They will continue to be evicted until the memory usage drops below the `target_memory_usage`, set in the setting below, or until the `min_cache_ttl` is hit. There is no default value for this option. From ea6cc6e9837bfc9349f343b105edc7e41641a793 Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 18 May 2022 09:58:33 -0700 Subject: [PATCH 5/5] Update docs/usage/configuration/config_documentation.md Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- docs/usage/configuration/config_documentation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 76b96aef511a..dac79260a73a 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1125,7 +1125,8 @@ Caching can be configured through the following sub-options: to utilize this option, and all three of the options must be specified for this feature to work. This option defaults to off, enable it by providing values for the sub-options listed below. Please note that the feature will not work and may cause unstable behavior (such as excessive emptying of caches or exceptions) if all of the values are not provided. - Please see the [Config Conventions](#config-conventions) for information on how to specify memory size. + Please see the [Config Conventions](#config-conventions) for information on how to specify memory size and cache expiry + durations. * `max_cache_memory_usage` sets a ceiling on how much memory the cache can use before caches begin to be continuously evicted. They will continue to be evicted until the memory usage drops below the `target_memory_usage`, set in the setting below, or until the `min_cache_ttl` is hit. There is no default value for this option.