-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MM-58729: Improve proxy cache configuration #788
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the investigation! I wonder that given that none showed improvements, do we want/need to change them? I'm ok with the change of proxy_cache_lock_timeout
, since we wanted to make timeouts easier to debug, but what about proxy_cache_min_uses
? I'm not opposed to it, but I'm not entirely sure of the benefit.
The benefit of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Have you had a chance to review the proxy_cache_path
directive as well?
I noticed the below comment seems somewhat inaccurate:
mattermost-load-test-ng/deployment/terraform/create.go
Lines 798 to 799 in 6f5a0c9
cacheSize = "16g" // Ideally we'd like half of the total server mem. But the mem consumption rarely exceeds 10G | |
// from my tests. So there's no point stretching it further. |
As far as I understand, max_size
controls disk space, not memory. It's also not really required given:
When the size is exceeded or there is not enough free space, it removes the least recently used data.
Another thing to check is whether we have eliminated the [alert] 3892#3892: could not allocate node in cache keys zone "mattermost_cache"
log.
Tangential, but it would be great to look into cache instrumentation and get something to show on Grafana. Could be an interesting side project (OSF) or help wanted.
Resources:
https://blog.nginx.org/blog/nginx-caching-guide
https://www.f5.com/company/blog/nginx/nginx-high-performance-caching
@@ -195,9 +195,10 @@ proxy_pass http://backend; | |||
const nginxCacheCommonConfig = ` | |||
proxy_cache mattermost_cache; | |||
proxy_cache_revalidate on; | |||
proxy_cache_min_uses 2; | |||
proxy_cache_min_uses 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am supportive of this change (caching slightly more aggressively) especially since it's nginx's default.
Ahh, yes I missed to check that. Looks like I need to run more tests. |
Tested with various combinations of settings. None of them showed a major improvement. Therefore, settled on the very basic changes.
Full thread here: https://community.mattermost.com/core/pl/rjbg3yr3mfrrfrcq7zk3eo6gky
https://mattermost.atlassian.net/browse/MM-58729
https://mattermost.atlassian.net/browse/MM-59871