________________________________ From: Daniel Friesen lists@nadir-seen-fire.com To: "mediawiki-l@lists.wikimedia.org" mediawiki-l@lists.wikimedia.org Sent: Wednesday, March 14, 2012 5:04 PM Subject: Re: [Mediawiki-l] building a replica/backup media wiki
On Wed, 14 Mar 2012 14:51:06 -0800, Joseph Spenner joseph85750@yahoo.com wrote:
I'm currently trying to run a nightly backup/copy of my production media wiki to a "read only" copy on another system. I wrote a script to do everything through ssh:
#!/usr/bin/ksh
scripts=/scripts
mysqldump --opt wikidb -u root -psomePass > $scripts/wikidb.sql
scp $scripts/wikidb.sql 10.4.3.1:tmp || exit
sleep 3
ssh 10.4.3.1 '/usr/bin/mysql -u root -psomePass wikidb < tmp/wikidb.sql' || exit
echo replica wiki database updated
echo syncing attachments and files
rsync --delete -avz -e ssh /var/www/htdocs/wiki/images root@10.4.3.1:/var/www/htdocs/wiki
My copy/replica has an entry in the LocalSettings.php to make it a read-only wiki:
$wgReadOnly = 'Read Only';
It works great.
However, when I access the replica after a period of time, it's VERY slow/sluggish. If I edit the LocalSettings.php file and disable the 'read only' line, it's lightning fast again. If I then change it back to 'read only', it's still fast but slows down over the course of the night.
The only way around this was to make a little script which places a normal edit-able LocalSettings.php file into place, then does a wget to one of the wiki pages, then copies the 'read only' version of the LocalSettings.php file back into place. After I run the script, it's fast again.
Anyone know why this slowness occurs? I've tested the mysql response time via command line while the wiki is slow, and the mysql is still fast. It's some interaction between apache and mysql which causes this replica to slow down. If I try to access a 'non wiki' document (ie: some file on the webserver) it does not have any latency.
Any ideas/help would be great.
Thanks!
If you turn off read only but set $wgMainCacheType = CACHE_NONE; does your wiki feel as slow as it does overnight?
===
I just checked and already have the setting: $wgMainCacheType = CACHE_NONE;