Topic on Project:Support desk

Jump to: navigation, search
Holygamer (talkcontribs)

My Versions: MediaWiki: 1.16.5, PHP: 5.2.17, MySQL: 5.1.61

Within the last couple of days whenever I edit a page in my MediaWiki site it takes up to 40 seconds to save the page. Previously it only took a few seconds. What is causing this problem? It's just saving pages that's slow, browsing my site by clicking on page links is fast.

I have over 2000 pages in my site but surely that's not causing the problem? I have a dedicated server with no visitors to my site. I know it's not my internet connection that's the problem because I also have another MediaWiki site on another host (shared hosting) and the pages only take a few seconds to save there. (talkcontribs)

No, 2000 pages is no problem. The main difference between viewing and editing is I would say that when you edit something, you can be sure that data will be written to disc. Maybe you have a problem with writing something to disc? Or maybe you have an issue with your database? Activating the MySQL slow query log should help to check that.

Holygamer (talkcontribs)

OK thanks. How would I do that? I know HTML but I'm not familiar with code or how to perform queries, etc. What would I do with the results from the query? (talkcontribs)

In the MySQL slow query log the MySQL server logs all queries, which took longer then a certain amount of time to complete (I think it's 1 or 2 seconds). This can help you see, if it is your database, which is slow (or probably something else).

To enable the MySQL slow query log, simply add the following line to the MySQL configuration file (my.cnf or my.ini), and then restart the MySQL server:



log-slow-queries = [path to the log file]

Replace [path to the log file] with the path to the slow query log file you want MySQL to write the log to.

Here is the MySQL manual. It has an overview of all available options.

Then edit a page, wait the time and check, if there is an entry in that log. Sidequestion: Are you responsible for the server yourself, or do you have someone, who normally does things like that for you?

Holygamer (talkcontribs)

I have a Dedicated Server which I have access to. If I need stuff done which I don't understand I will get my host to do it. (talkcontribs)

Then ask your host to check the slow query log for you.

Or maybe better: If you didn't change anything, the issue obviously is not caused by you. Ask your host if he knows a possible reason; maybe he has changed something in the configuration or so.

Holygamer (talkcontribs)

My host says that the slow query log doesn't show anything. Is there anything else I can do? (talkcontribs)

Yes: Ask your host if he knows a possible reason; maybe he has changed something in the configuration or so.

Holygamer (talkcontribs)

They say they haven't changed anything and they don't know of a reason (talkcontribs)

And you accept this "We don't know and now shut up" as an answer? I mean: You didn't change anything and now it's broken. What do you pay him for? For this insufficient output? I guess not. If the host is responsible for the server, he is the one who should fix the problem. If he is not capable of doing so, maybe you should change to a host who is more reliable.

Bawolff (talkcontribs)

It could be other things then your hosts fault.

If you're using super complicated templates (like things copied from wikipedia.) they can be expensive to parse. A page save involves a parse, where a view might not. So you may want to try saving a page with just a single letter on it. If that is slow, its likely to be something with db, if it is not slow then its not the db's fault (in all probability)

You can also enable Profiling to be able to tell you exactly which part of MediaWiki is slow. That would be able to tell you if its the db taking forever, or something else.

Certain extensions may cause things to be slow as well.

Holygamer (talkcontribs)

Is there a simpler guide anyware which explains how to enable profiling as I can't get it working.

Bawolff (talkcontribs)

No. Profiling is as simple as it gets (Usually its only necessary on really big sites, so it doesn't get documented as much).

Other things you can try - see if ?action=purge takes same amount of time as an edit (If so probably the issue is parsing time, otherwise, the db theory looks more likely).

Also try disabling all extensions, and see if that makes a difference (Its possible for a poorly implemented extension to have an averse affect on how much time mediawiki takes)

Tree1891 (talkcontribs)

I have same problem.

My Versions
MediaWiki 1.19.0
PHP 5.3.12 (apache2handler)

It seems that the cause is using images of wikipedia commons. The problem page have some images such as Deletion icon.svg, Bulbgraph.svg and saving this page takes over 40 Seconds. Removing images of wikipedia commons, it works well.

Tree1891 (talkcontribs)

I know that InstantCommons-enabled wikis cache Commons content so that it is only downloaded once.

Where is the Commons content cache?

It seems that my wiki doesn't cache Commons content.

Jdpipe (talkcontribs)

You might want to look at whether it's mediawiki's email notification feature that is slowing down the page save. If you have poorly configured settings for PHP to send emails, it will block the page for 20 seconds or more.

Reply to "Saving Pages takes Over 40 Seconds"