From: Aaron Schulz Date: Sun, 8 Jan 2017 03:00:00 +0000 (-0800) Subject: Add an refresh probability comment to worthRefreshPopular() X-Git-Tag: 1.31.0-rc.0~4356^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=b0e0f6e3b37ce5f64881f6da7e7380c682f019e2;p=lhc%2Fweb%2Fwiklou.git Add an refresh probability comment to worthRefreshPopular() Change-Id: Ia6717881c7d5c19481c87ade5972c0ff641d6e11 --- diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 8d3c6d96e4..eec5fc699f 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -1358,7 +1358,9 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { return false; } - // Lifecycle is: new, ramp-up refresh chance, full refresh chance + // Lifecycle is: new, ramp-up refresh chance, full refresh chance. + // Note that the "expected # of refreshes" for the ramp-up time range is half of what it + // would be if P(refresh) was at its full value during that time range. $refreshWindowSec = max( $timeTillRefresh - $ageNew - self::RAMPUP_TTL / 2, 1 ); // P(refresh) * (# hits in $refreshWindowSec) = (expected # of refreshes) // P(refresh) * ($refreshWindowSec * $popularHitsPerSec) = 1