Jump to content

Disk-backed object cache

From mediawiki.org

The Disk-backed object cache project evaluated supplementing the memcache-based object cache, which would greatly increase the amount of space dedicated to caching parsed pages.

Rationale

[edit]
Parser cache hit ratio graph for Wikimedia wikis was merely 30%, as of March 2011.

Our parser cache hit ratio is very low, around 30%.

This seems to be mostly due to insufficient parser cache size. Tim's theory is that if we increased the parser cache size by a factor of 10-100, then most of the yellow area on that graph should go away. This would reduce our Apache CPU usage substantially.

The parser cache does not have particularly stringent latency requirements, since most requests only do a single parser cache fetch.

Timeline

[edit]

After an initial attempt to deploy Ehcache, we switched to a different strategy of deploying a custom MySQL-based solution. This is on the WMF MediaWiki Core developers' roadmap, slated for work by Tim Starling soon after the 1.17 release.

Metrics

[edit]
Before and after enabling the new MySQL-based parser cache, July 2011.
Parser cache hit-ratio improving while the new MySQL-based parser cache is filling up over a two week period, July 2011.
  • Parser cache hit rate:
    • last 8 hours
    • last 8 days
    • Historic (pre-improvement) norm: 30% hit, 68% miss (absent), and <2% miss (expired)
    • The goal is to minimize the yellow area (cache miss - absent)
  • Apache CPU
  • Disk usage
    • Overview
    • The cache started out at 2.1 terabytes, so the cache size should is 2.1 TB minus the disk free.

Additional documents

[edit]