Extension:Memcached

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
Memcached
Release status: stableCategory:Stable extensions
Implementation Special page Category:Special page extensions
Description Provides an interface for checking if Memcached is working fine
Author(s) MarkAHershberger
Latest version 2.1.0 (2021-11-09)
MediaWiki 1.31+Category:Extensions with manual MediaWiki version
Database changes No
Composer mediawiki/memcachedCategory:Extensions supporting Composer
License GNU General Public License 3.0 or later
Download Category:Extensions in GitLab version control
Category:All extensions

The Memcached extension provides an interface for checking if Memcached is working fine.

Description

When I installed Memcached on my wiki server I had a problem to regularly check if it works fine or should be restarted. Because sometimes it crashes and the wiki opens way too long which is annoying. I assume this happens when Memcached works many days non-stop. So I added a cron task to restart the Memcached service once a day in case it crashes again. But what if it crashes before the cron task runs? All users have to wait until it is restarted.

So every day I have to login through SSH to check the status of Memcached service. This is boring to type login and password each time. There should be an easier way. At first I found a PHP-script for checking Memcached status. It was good but was allowed to run by everyone who knew its file name. For security purpose we don't want anyone to find out the IP and port of our Memcached server(-s). Thus I came to the conclusion: it would be great to implement it as a MediaWiki extension and deny access for everyone but admin.

Since I didn't find any Memcached extension at all (which is shame because, for instance, APC extension existed for a long time), I decided to create my own. I've been modifying plenty of MediaWiki extensions for myself but never created one. This is my first separate extension so suggestions are welcome.

Usage

First of all, you need to install Memcached and define its servers in $wgMemCachedServers. Don't forget to install PECL memcache for PHP (do not confuse with PECL memcached which is currently not supported).

If you've already done it go to "Special:Memcached" and you'll see the list of memcached servers with their status (working, not working or no memcache service found).

Installation

User rights
  • memcached - the right to view the Special:Memcached page. By default allowed only for bureaucrats. You may change it if you wish.

See also

Category:Languages pages Category:Cache Category:Performance tuning
Category:All extensions Category:Cache Category:Extensions in GitLab version control Category:Extensions requiring Composer with git Category:Extensions supporting Composer Category:Extensions which add rights Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:Languages pages Category:Performance tuning Category:Special page extensions Category:Stable extensions