Skip to content
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

[QUESTION] Possible unexpected behavior in cacheSize/cacheItems metrics #461

Open
hulk8 opened this issue Sep 6, 2024 · 1 comment
Open

Comments

@hulk8
Copy link
Contributor

hulk8 commented Sep 6, 2024

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.
image

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?

@hulk8
Copy link
Contributor Author

hulk8 commented Sep 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant