[QUESTION] Possible unexpected behavior in cacheSize/cacheItems metrics
Question details
I have an original Grafana dashboard for chproxy and faced issue with current cache size and cache items metrics.
In my configuration there is a expire: 15m and max_size: 200Gb configs but on the dashboard and in metrics gauge values cacheItems and cacheSize are keep increasing. As I know, gauge can go up and down.
Cache config:
caches:
- name: "shortterm"
mode: "file_system"
file_system:
dir: "/app/chproxy/shortterm/cache"
max_size: 200Gb
expire: 15m
shared_with_all_users: true
Is this is an expected behavior? Does chproxy clear cache files only when max_size is reached?
It looks like unexpected behavior in expire := f.expire + f.grace.
As far as I understand, expire calculated like this to prevent thundering herd and in fact calculated like this expire = expire + max_execution_time (because of this). Unexpected behavior is that cache persists after expire and max_execution_time cannot be big - cache will accumulate, and cannot be low - queries will be killed after max_execution_time timeout.