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

Calculate hitrate the same way varnishstat does it #59

Closed
wants to merge 2 commits into from

Conversation

scheying
Copy link

Using the client request rate for hitrate calculation is not accurate because there are things like ESI that increase hits without increasing client requests. This is how varnishstat does it: https://github.com/varnishcache/varnish-cache/blob/9b5332e2a2e0c5d3a0485704164ea9d3cebe4b68/bin/varnishstat/varnishstat_curses.c#L300

Using the client request rate for hitrate calculation is not accurate because there are things like ESI that increase hits without increasing client requests. This is how varnishstat does it: https://github.com/varnishcache/varnish-cache/blob/9b5332e2a2e0c5d3a0485704164ea9d3cebe4b68/bin/varnishstat/varnishstat_curses.c#L300
@@ -114,6 +114,7 @@
"targets": [
{
"expr": "avg(( rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) / rate(varnish_main_client_req{instance=~\"^($varnish_instance).*\"}[5m]) ))",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to remove this line if you want to replace it

@jonnenauha
Copy link
Owner

I've merged another PR that fixed this same issue. Thanks!

@jonnenauha jonnenauha closed this Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants