Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I set up my MediaWiki on a CentOS. In the first few months, it works fine and fast. But it seems gradually getting slower.

My wiki site has less than 50 pages, so it's a very small scale site. But it seems every first time when loading the page, it takes couple seconds for apache server to parse the php scripts. But the second time visit same page is instant since I configured MediaWiki's caching method as CACHE_ALL. I've also installed eAccelerator.

How to resolve this performance issue? Thanks.

EDIT: DB is MySQL.

share|improve this question
    
What DB engine? –  GruffTech Jul 15 '10 at 22:54
    
Dupe of serverfault.com/questions/160947/…, or vice versa –  dsolimano Jul 16 '10 at 4:24
    
@GruffTech: DB is MySQL. –  Stan Jul 16 '10 at 7:33

2 Answers 2

up vote 1 down vote accepted

This might not be correct in your case. But, typically the answer to this question for a database application is that the database needs vacuumed, optimized or some such as is appropriate for the database in question. From what I can find it looks like mysql has an OPTIMIZE TABLE command. I'd look into that.

share|improve this answer
    
Both answers are really helpful. But after I optimize database, the page loading time just like instant as before. Thanks Banis. –  Stan Jul 17 '10 at 14:55
    
I use shell command 'mysqlcheck' to achieve this job. Is there any way to schedule this task every month? If I do it in crontab, I have to expose the password which is not ideal (with command like 'mysqlccheck -o -u xxx -p xxx). Thanks. –  Stan Jul 17 '10 at 16:54
    
I mean 'mysqlccheck -o -u xxx -p xxx databaseName' –  Stan Jul 17 '10 at 16:58
    
Mysql is not a database I know much about, but from what I can find you will need to build a cron job for this and put the password in that cron job. You can chmod the cronjob to 700 to minimize the danger. I'd run the task daily though. Do it late at night at some time when nothing else much is happening on the box. –  Banis Jul 17 '10 at 20:21

Use squid/varnish. If you don't want to go through that, you could always enable the file cache in MediaWiki.

share|improve this answer
    
I enabled php cache & file cache, and did see loading speed improved. However, for the first time to load the page, still seeing a bit slow. I check the CPU usage by 'top', and can see like 20% CPU usage for httpd when loading those slow pages, while mysqld is negligible. Any idea? –  Stan Jul 16 '10 at 17:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.