Page MenuHomePhabricator

MediaWiki does not support memcached through unix sockets
Closed, InvalidPublic

Description

From my Support Desk post I learned that MediaWiki does not support memcached through unix sockets, only TCP ports.

Please add support for running memcached through unix sockets.

Event Timeline

MadenssContinued raised the priority of this task from to Needs Triage.
MadenssContinued updated the task description. (Show Details)
MadenssContinued subscribed.
Aklapper triaged this task as Lowest priority.Dec 28 2014, 11:33 PM

De facto it works when configured directly in LocalSettings.php in $wgMemCachedServers, but the Web installer mandates the form IP:PORT or DOMAIN:PORT.

Depending on the Memcached driver, the Unix socket’s path must be written differently:

  • if $wgMainCacheType = 'memcached-pecl'; then $wgMemCachedServers = [ '/run/memcached/memcached.sock' ];, see PHP doc for Memcached::addServer()
  • if $wgMainCacheType = 'memcached-php'; then $wgMemCachedServers = [ 'unix:///run/memcached/memcached.sock' ];, see PHP doc for fsockopen and list of transports (specifically Unix domains) -- since the PHP implementation MemcachedClient uses fsockopen.

Whether MediaWiki officially supports Unix sockets (or more generally other transports like TLS, etc) should be discussed.

I see this was independently documented on Manual:$wgMemCachedServers, so perhaps this task could be marked as solved.