Lightsquid Hit Percentage
-
Also HIT is always 0%…
-
Also HIT is always 0%…
That has nothing to do with lightsquid, it just reports what it sees in the log. Perhaps you're not getting any cache hits. That would be a general squid config issue, nothing to do with the packages even. Try starting a thread on the proxy board for help with that.
-
Umm my hit rate is actually quite high according to access.log
-
I think I found why HIT is always 0.00%
/usr/local/www/lightsquid/lightparser.pl
LINE 205if ($Ltype =~ m/HIT/) { $CacheHIT+=$Lsize; } else { $CacheMISS+=$Lsize; }
HIT and also TCP_REFRESH_UNMODIFIED/200 should count as served from cache right?
-
That is not pfSense package code, it's lightsquid code. Not our circus, not our monkeys.
-
Thank you.
But not to start whole new thread for that, can you please show me how to add my string to the line in question?
if ($Ltype =~ m/HIT/) {
$CacheHIT+=$Lsize;
} else {
$CacheMISS+=$Lsize;
}Thanks a bunch!
-
And I already started new thread - I deleted it.
Post:Hi all!
I`ve installed lightsquid on 2.3 (thanks Jimp!) and encountered some issues with interpretation of what is hit and what is not.
In lightparser.pl there is condition:
if ($Ltype =~ m/HIT/) { $CacheHIT+=$Lsize; } else { $CacheMISS+=$Lsize; }
It is wrong in my opinion as it should also take in account TCP_REFRESH_UNMODIFIED.
So how to modify this condition to reflect correct status?
As I can see it, lightsquid project is dead, maybe we could alter the package code to reflect this change?
Thanks!
-
I did it like this:
if ($Ltype =~ m/HIT/) { $CacheHIT+=$Lsize; } if ($Ltype =~ m/UNMODIFIED/) { $CacheHIT+=$Lsize; } else { $CacheMISS+=$Lsize; }
I`m not a coder :)
-
I did it like this:
if ($Ltype =~ m/HIT/) { $CacheHIT+=$Lsize; } if ($Ltype =~ m/UNMODIFIED/) { $CacheHIT+=$Lsize; } else { $CacheMISS+=$Lsize; }
I`m not a coder :)
Try this:
if ($Ltype =~ m/(HIT|UNMODIFIED)/) { $CacheHIT+=$Lsize; } else { $CacheMISS+=$Lsize; }
-
Thanks Renatho!
It does the trick :)
Could we implement this in package if it is correct?
According to: http://wiki.squid-cache.org/SquidFaq/SquidLogs?action=fullsearch&context=180&value=TCP_REFRESH_UNMODIFIED&titlesearch=Titles#Squid_result_codes
and: http://squid-web-proxy-cache.1019090.n4.nabble.com/A-lot-of-TCP-REFRESH-UNMODIFIED-after-upgrading-squid-td4660249.htmlTCP_REFRESH_UNMODIFIED is actually a HIT based on the origin server(or a
parent proxy).
if you have lots of TCP_REFRESH_UNMODIFIED in your log file you can tell
your clients (in a case of only one proxy between the client and the
site) that they get it from cache while making sure it's the file they
should get and also the server knows that yet another client gets a good
and valid reply.So REFRESH UNMODIFIED is actually a HIT and a lot more of REFRESH UNMODIFIED appeared in Squid 3.X.
-
No, it's in lightsquid's code, not ours. You'd have to submit that to the lightsquid project (assuming it hasn't been abandoned)
-
All I can see are dates 2010 and lower.
So I guess this won't be possible? -
All I can see are dates 2010 and lower.
So I guess this won't be possible?I've added the fix into FreeBSD's ports tree - https://svnweb.freebsd.org/ports?view=revision&revision=409887
It'll be imported to pfSense ports tree soon
-
Thanks!
I can only say that I will stick with pfsense `till the end :)