Jump to content

MediaWiki-Docker/Configuration recipes/Memcached

From mediawiki.org

You can setup a Memcached backend by following the steps below. NOTE: Memcached runs on port 11211 by default.

docker-compose.override.yml
services:
  memcached:
    image: memcached
    ports:
    # expose the TCP service to the host
    - "11211:11211"

Once you started all your containers restart it with docker compose restart and verified that the memcached container is running, you need to configure it LocalSetting.php:

$wgMainCacheType = CACHE_MEMCACHED;
$wgMemCachedServers = [ "host.docker.internal:11211" ];

With the code above, refresh your Main_Page and if everything is still working, then congratulations.

Bonus: You can also check Docker Desktop to monitor the stats of this container to see topics like: Network I/O, Memory usage, CPU usage etc

Memcached-docker

See also

[edit]