Add an refresh probability comment to worthRefreshPopular()
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 8 Jan 2017 03:00:00 +0000 (19:00 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 8 Jan 2017 03:00:00 +0000 (19:00 -0800)
Change-Id: Ia6717881c7d5c19481c87ade5972c0ff641d6e11

includes/libs/objectcache/WANObjectCache.php

index 8d3c6d9..eec5fc6 100644 (file)
@@ -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