Hi team! We want to set up memory consumption aler...
# community-help
d
Hi team! We want to set up memory consumption alerts for 85% of RAM as recommended. In case of kubernetes,
system_*
metrics in typesense report node’s metrics instead of pod’s, so they are not useful for monitoring. Should we use external kubernetes metrics in this case, or it is better to monitor one of
typesense_memory_*
metric?
k
Typesense memory is an accurate metric because it directly fetches those stats from the jemalloc allocator.
d
🤔 Should it take into the account cgroup memory/cpu limits? As far as I understand docker (and kubernetes) sets resource constraints via cgroup and in this environment setting
--memory-used-max-percentage
doesn’t help with OOM, for example: https://gist.github.com/b0g3r/2fcf88772cddf4bd4630a48bc1d63073 I’m not qualified enough to say if it is a good idea to respect cgroup in this context, usually applications I’m using don’t have an option to prevent OOM and we manage it externally via monitoring.
k
We didn't realize that these system memory api calls returned host memory and not container memory. We have to check if we can use alternate APIs. Can you please create an issue? We will add to our roadmap.
Since we rely on the system memory for throttling writes,
memory-used-max-percentage
won't be useful for container environments.