wiki.techinc.nl/includes/libs/objectcache
2019-10-22 03:38:58 +00:00
..
serialized objectcache: add object segmentation support to BagOStuff 2019-06-11 16:14:17 +01:00
utils objectcache: move MemcachedClient class to /utils subdir 2019-08-21 16:17:20 -07:00
wancache Merge "Fix new phan errors, part 6" 2019-10-20 18:05:18 +00:00
APCBagOStuff.php objectcache: improve BagOStuff arithmetic method signatures 2019-08-24 12:50:37 -07:00
APCUBagOStuff.php objectcache: make incr() and incrWithInit() atomic in APCUBagOStuff 2019-10-14 09:43:37 +00:00
BagOStuff.php Unsuppress phan issues part 6 2019-09-01 09:48:45 +00:00
CachedBagOStuff.php objectcache: improve BagOStuff arithmetic method signatures 2019-08-24 12:50:37 -07:00
EmptyBagOStuff.php objectcache: improve BagOStuff arithmetic method signatures 2019-08-24 12:50:37 -07:00
HashBagOStuff.php Upgrade phan config to 0.7.1 2019-09-04 08:20:53 +00:00
IExpiringStore.php Remove @author Timo Tijhof from various file headers 2019-07-08 21:56:24 +00:00
IStoreKeyEncoder.php objectcache: Use variadic signature for makeKey() 2019-07-23 20:44:06 +02:00
MediumSpecificBagOStuff.php Unsuppress phan issues part 6 2019-09-01 09:48:45 +00:00
MemcachedBagOStuff.php objectcache: Optimise array_map in MemcachedBagOStuff::makeKey() 2019-08-31 22:43:21 +01:00
MemcachedPeclBagOStuff.php objectcache: improve BagOStuff arithmetic method signatures 2019-08-24 12:50:37 -07:00
MemcachedPhpBagOStuff.php objectcache: improve BagOStuff arithmetic method signatures 2019-08-24 12:50:37 -07:00
MultiWriteBagOStuff.php Remove more HHVM hacks 2019-10-06 10:16:09 +00:00
README.md objectcache: add regen_walltime metric to WANObjectCache::getWithSetCallback() 2019-07-14 17:08:44 +00:00
RedisBagOStuff.php Unsuppress more phan issues (part 3) 2019-08-31 16:38:55 +00:00
ReplicatedBagOStuff.php Fix a typo (yeild -> yield) 2019-09-13 03:38:14 +00:00
RESTBagOStuff.php Fix example Kask configuration in RESTBagOStuff class comment 2019-10-15 22:43:42 +00:00
WinCacheBagOStuff.php objectcache: improve BagOStuff arithmetic method signatures 2019-08-24 12:50:37 -07:00

wikimedia/objectcache

Statistics

Sent to StatsD under MediaWiki's namespace.

WANObjectCache

The default WANObjectCache provided by MediaWikiServices disables these statistics in processes where $wgCommandLineMode is true.

wanobjectcache.{kClass}.{cache_action_and_result}

Call counter from WANObjectCache::getWithSetCallback().

  • Type: Counter.
  • Variable kClass: The first part of your cache key.
  • Variable result: One of:
    • "hit.good",
    • "hit.refresh",
    • "hit.volatile",
    • "hit.stale",
    • "miss.busy" (or "renew.busy", if the minAsOf is used),
    • "miss.compute" (or "renew.busy", if the minAsOf is used).

wanobjectcache.{kClass}.regen_set_delay

Upon cache miss, this measures the time spent in WANObjectCache::getWithSetCallback(), from the start of the method to right after the new value has been computed by the callback.

This essentially measures the whole method (including retrieval of any old value, validation, any locks for lockTSE, and the callbacks), except for the time spent in sending the value to the backend server.

  • Type: Measure (in milliseconds).
  • Variable kClass: The first part of your cache key.

wanobjectcache.{kClass}.regen_walltime

Upon cache miss, this measures the time spent in WANObjectCache::getWithSetCallback() from the start of the callback to right after the new value has been computed.

  • Type: Measure (in milliseconds).
  • Variable kClass: The first part of your cache key.

wanobjectcache.{kClass}.ck_touch.{result}

Call counter from WANObjectCache::touchCheckKey().

  • Type: Counter.
  • Variable kClass: The first part of your cache key.
  • Variable result: One of "ok" or "error".

wanobjectcache.{kClass}.ck_reset.{result}

Call counter from WANObjectCache::resetCheckKey().

  • Type: Counter.
  • Variable kClass: The first part of your cache key.
  • Variable result: One of "ok" or "error".

wanobjectcache.{kClass}.delete.{result}

Call counter from WANObjectCache::delete().

  • Type: Counter.
  • Variable kClass: The first part of your cache key.
  • Variable result: One of "ok" or "error".

wanobjectcache.{kClass}.cooloff_bounce

Upon a cache miss, the WANObjectCache::getWithSetCallback() method generally recomputes the value from the callback, and stores it for re-use.

If regenerating the value costs more than a certain threshold of time (e.g. 50ms), then for popular keys it is likely that many web servers will generate and store the value simultaneously when the key is entirely absent from the cache. In this case, the cool-off feature can be used to protect backend cache servers against network congestion. This protection is implemented with a lock and subsequent cool-off period. The winner stores their value, while other web server return their value directly.

This counter is incremented whenever a new value was regenerated but not stored.

  • Type: Counter.
  • Variable kClass: The first part of your cache key.

When the regeneration callback is slow, these scenarios may use the cool-off feature:

  • Storing the first interim value for tombstoned keys.

    If a key is currently tombstoned due to a recent delete() action, and thus in "hold-off", then the key may not be written to. A mutex lock will let one web server generate the new value and (until the hold-off is over) the generated value will be considered an interim (temporary) value only. Requests that cannot get the lock will use the last stored interim value. If there is no interim value yet, then requests that cannot get the lock may still generate their own value. Here, the cool-off feature is used to decide which requests stores their interim value.

  • Storing the first interim value for stale keys.

    If a key is currently in "hold-off" due to a recent touchCheckKey() action, then the key may not be written to. A mutex lock will let one web request generate the new value and (until the hold-off is over) such value will be considered an interim (temporary) value only. Requests that lose the lock, will instead return the last stored interim value, or (if it remained in cache) the stale value preserved from before touchCheckKey() was called. If there is no stale value and no interim value yet, then multiple requests may need to generate the value simultaneously. In this case, the cool-off feature is used to decide which requests store their interim value.

    The same logic applies when the callback passed to getWithSetCallback() in the "touchedCallback" parameter starts returning an updated timestamp due to a dependency change.

  • Storing the first value when lockTSE is used.

    When lockTSE is in use, and no stale value is found on the backend, and no busyValue callback is provided, then multiple requests may generate the value simultaneously; the cool-off is used to decide which requests store their interim value.