Testing procedure for proper configuration?
Any ideas on how to test proper function? We can see it is running, but it seems silly to plan performance tests to figure out whether it is properly configured (and php correctly compiled with --enable-sockets -- is this the default or how to test that?). Thanks in advance! --Vigilius 20:27, 29 July 2008 (UTC)
- If it's consuming memory, it's probably working. Use ab to benchmark performance with
$wgMainCacheType = CACHE_MEMCACHED;and then with
$wgMainCacheType = CACHE_NONE;if you want confirmation. —Emufarmers(T|C) 08:28, 30 July 2008 (UTC)
Memcached via UNIX Socket
I'm using a single machine with memcached and Mediawiki 1.14.0. Is there a chance to setup a UNIX Socket like:
$wgMemCachedServers = array( "/var/socket/memcached.sock" );
Any help would be appreciated.
- I think you should be able to just leave $wgMemCachedServers on the default (localhost). —Emufarmers(T|C) 04:59, 29 May 2009 (UTC)
- Judging by “includes/memcached-client.php” code, MW doesn't support unix sockets for memcached addresses (not in 1.16 yet, at least). And no, leaving the default is unrelated. —HoverHell, 21:10, 23 September 2010 (UTC)
Is this still impossible??? I am using a hosting that does noe allow memcached with ports because of the security problems... this shouldn't be too hard to implement, right?? JEH 2013-08-11
- Hi folks!
- I've managed to get unix domain socket connections to work with MW Memcached:
$wgMemCachedServers = array("unix:///var/socket/memcached.sock:0");
- and then configure your memcached.conf, making sure to deactivate -p and -l options and set -s and -a accordingly. Here's a sample memcached.conf:
# unix domain socket makes it faster, no TCP overhead # be sure to disable -l 127.0.0.1 and -p 11211 -s /var/run/memcached/memcached.sock -a 0766
How is it possible to clear the cache?
When I want to change the template of my wiki, many user have because of memcached the old version, although there is a new version online. how can I clear the cache with a ssh command? --tada
- Hu... Simply restart the memcached daemons ^^ --188.8.131.52 00:22, 27 June 2009 (UTC)
- Sometimes we can not restart memcached for it is run by root. I use simple mainatenance script such as
<?php $fp = @fsockopen( '127.0.0.1', 11211, $errno, $fsockerr, 1.0 ); fwrite( $fp, "flush_all\r\n" );
--Roma7 13:09, 10 December 2009 (UTC)
Error with memcached
I get an error with memcached and mediawiki 1.15.1
Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 122880 bytes) in /var/www/mediawiki-1.15.1/includes/db/LoadBalancer.php on line 315
Can anybody help?
Deciding whether to use memcached
What is more important in deciding whether to use memcached — size or load? E.g., if I have a wiki that's as large as Wikipedia but doesn't have much load, should I still use memcached? Thanks, Tisane 15:03, 8 May 2010 (UTC)
Memcached slows server
Before I had page generation time of about 0.5 seconds, but then I setup a separate server installed with memcached using all default settings. I changed my LocalSettings.php file to use memcached, and now my page load times are about 11.0 seconds. Is this normal for the first couple requests, or what might the problem be? Also, besides changing the settings in LocalSettings.php, and creating the server, is there anything else I need to do? On the page it talks about running "memcached -d -l 127.0.0.1 -p 11211 -m 64". On which server would I run that? --Jer Hughes 05:05, 27 March 2011 (UTC)
- Use memcached only if you have more than one web server. Otherwise, local caching like APC should be used. Max Semenik 07:06, 27 March 2011 (UTC)
- Thanks for the reply. I am using more than one web server. I think I found my problem, but not yet a solution. I think MediaWiki is trying to connect to the memcached server, but is timing-out after about 10-seconds. I do know that my unmodified memcached server is working, as I'm able to successfully run a php test script (outside of MediaWiki but on the same server as it). In my error logs on my MediaWiki server, I'm getting the following errors when MediaWiki is configured to use memcached:
[27-Mar-2011 17:35:43] PHP Warning: Illegal offset type in isset or empty in [...]/w/includes/memcached-client.php on line 958 [27-Mar-2011 17:35:43] PHP Warning: Illegal offset type in isset or empty in [...]/w/includes/memcached-client.php on line 965 [27-Mar-2011 17:35:43] PHP Warning: Illegal offset type in isset or empty in [...]/w/includes/memcached-client.php on line 958 [27-Mar-2011 17:35:43] PHP Warning: Illegal offset type in isset or empty in [...]/w/includes/memcached-client.php on line 965 [27-Mar-2011 17:35:43] PHP Warning: Illegal offset type in isset or empty in [...]/w/includes/memcached-client.php on line 958 [27-Mar-2011 17:35:43] PHP Warning: Illegal offset type in isset or empty in [...]/w/includes/memcached-client.php on line 965 ...
- --Jer Hughes 22:46, 27 March 2011 (UTC)
- Perhaps the server you're trying to connect to isn't actually the one running memcached, or perhaps it's firewalled so that you can't reach it, or maybe you're not connecting to it properly. It's pretty hard to tell, since you haven't told us anything about your configuration. —Emufarmers(T|C) 04:21, 28 March 2011 (UTC)
- I'm pretty sure its not a firewall or memcached server issue, because I can connect to that server, and see things caching, when running simple memcached test scripts on the server MediaWiki is running on. I'm thinking that it is a connection issue, but I just don't know where. I did some profiling and came back with these results:
10.542311 1 - MediaWiki::performAction 10.542140 1 - Article::view 10.170179 193 - wfMsgReal 10.004816 1 - MessageCache::load 0.641324 1 - WebStart.php-conf 0.316287 1 - Parser::parse 0.316239 1 - Parser::parse-unknown 0.305995 1 - MediaWiki::finalCleanup ...
- Further, the only settings I have for memcached on the wiki server is:
$wgMainCacheType = CACHE_MEMCACHED; $wgMemCachedServers = array("XX.XX.XXX.XXX:XXXXX"); // Using my real IP address and port
- --Jer Hughes 01:25, 26 April 2011 (UTC)