Last modified: 2013-10-23 18:17:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37891, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35891 - Site slow with memcached misconfigured
Site slow with memcached misconfigured
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.18.x
PC Linux
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-11 18:52 UTC by Matt Balkam
Modified: 2013-10-23 18:17 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Valgrind compatible profile data from XDebug (351.96 KB, application/x-gzip)
2012-04-11 18:52 UTC, Matt Balkam
Details

Description Matt Balkam 2012-04-11 18:52:16 UTC
Created attachment 10405 [details]
Valgrind compatible profile data from XDebug

Hi,

I fixed this problem, but it was difficult to diagnose.  I configured my MediaWiki installation to cache using memcached.  Unfortunately I set the port to find memcached on incorrectly (11212 instead of 11211).  The end result was that it took 10 seconds to load a page.  I couldn't find any errors in the logs, even though I turned on debug logging.  Eventually I installed XDebug and profiled the code.  The result can be seen in the attachment.  Basically all the time is being spent in the php::sleep function inside of MessageCache->lock.

Obviously, this was a misconfiguration error on my part, but it would be nice if the error was detected and logged somehow.

Anyway, thanks for all the hard work on a great project!

Matt
Comment 1 Max Semenik 2012-04-11 18:54:32 UTC
Shouldn't we just throw an exception if we can't connect to memc?
Comment 2 Sam Reed (reedy) 2012-04-11 18:55:34 UTC
There is a timeout on connections to memcahed, and it defaults to 0.1...
Comment 3 Sam Reed (reedy) 2012-04-11 18:56:34 UTC
(In reply to comment #2)
> There is a timeout on connections to memcahed, and it defaults to 0.1...

Also, with debugging set, there is:

		if ( !$sock ) {
			if ( $this->_debug ) {
				$this->_debugprint( "Error connecting to $host: $errstr\n" );
			}
			return false;
		}

Which would have been enabled if you had set $wgMemCachedDebug to true...

Almost a WFM
Comment 4 Matt Balkam 2012-04-11 19:07:35 UTC
So maybe I misunderstood how to resolve these types of issues.  I didn't go through the steps here http://www.mediawiki.org/wiki/Manual:How_to_debug

I assumed that errors would be logged to the apache log and I set the apache log level to debug.  Was I mistaken?
Comment 5 Mark A. Hershberger 2012-04-11 21:14:36 UTC
(In reply to comment #4)

> I assumed that errors would be logged to the apache log and I set the apache
> log level to debug.  Was I mistaken?

probably would help if you set $wgDebugLogFile
Comment 6 Matt Balkam 2012-04-11 21:16:00 UTC
Thanks for the help.  Sorry for the bother.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links