Topic on Project:Support desk

Silvernerd1 (talkcontribs)

Hi Mediwiki-professionals,

this is my first posting here and a good time to say "Hello everyone!".

I use MW since 1.25.1. My current version is 1.25.3. It is a very small installation, that I use first and last as a personal link page. In most cases, my page appears immediately, but in some cases, it lasts up to one minute, until the page appears. I used GTmetrix and Pagespeed to figure out the reasons, but I couln't find anything. Each time, my WM-Page is analyzed by these tools, it performs very quick.

I have an own managed server, where a few WordPress site are installed. They all work perfect without the issue mentioned here.

Has anyone of you got any idea, how I could solve this issue?

Thank you in advance.

--

Bfn

Michael

Florianschmidtwelzow (talkcontribs)

How long does it take to save an edit? The same time?

Silvernerd1 (talkcontribs)

Half a second. Up to now, the performance problems only came up, when I opened the page. It is a personal, password-protected link collection, that I use as startpage in my browsers.

Ciencia Al Poder (talkcontribs)

Maybe the slowness happens only on the first load of the page after some time without accessing it? Maybe the server is configured to shut down some worker processes to save resources on the server, and the first connection after a while wakes up a new thread, which may take a bit to initialize.

Silvernerd1 (talkcontribs)

That would be a good explanation. Unfortunately, the performance problem comes up unpredictabily. E.g. creating a new page lasted one minute a short time ago. I have beeen editing my page since a while, and everything worked fine up to that moment.

This post was hidden by Ciencia Al Poder (history)
Silvernerd1 (talkcontribs)

I further investigated this issue, and I found out, that the main problem is DOM loading and processing (analysis here).

Could this be a problem of accessing ressources like jquery / json / ajax / ... , that are loaded from external servers during runtime? Is it possible, to keep this ressources local? Or to cache them?

Silvernerd1 (talkcontribs)

It is not a problem of too many page revisions. I deleted all (800 or so) without any success.

It is also not a problem of the complexity of my start page. I declared an empty page as mainpage => no success ...

I have no ideas anymore ... :-(

Any suggestion would be highly appreciated.

--

Bfn

Michael

Ciencia Al Poder (talkcontribs)

Whoops, I started replying the other day but I probably got distracted by something and ended up not replying...

The problem is that load.php URL that takes 20 seconds.

The contents of those load.php URLs are cached in database, and then from time to time they're regenerated. I'd think they get regenerated when the URL changes because some dependency script is modified, but that shouldn't happen unless you perform an upgrade or touch some scripts... I'm not a ResourceLoader expert, though

Still, I don't know why it would take so long to serve that URL

Silvernerd1 (talkcontribs)

thank you for your reply.

Is there anything I can do now?

Ciencia Al Poder (talkcontribs)

You could add something like this at the end of LocalSettings.php to debug only load.php scripts:

if ( isset( $_SERVER['SCRIPT_NAME'] ) && pathinfo( $_SERVER['SCRIPT_NAME'] )['basename'] == 'load.php' ) {
    $wgDebugRawPage = true;
    // Uncomment this line to see all SQL queries being done
    //$wgDebugDumpSql  = true;
    // Adapt this path to a directory writable by the webserver
    $wgDebugLogFile = sprintf( '/var/log/mediawiki/loadphp-%s.log', substr( md5( $_GET['modules'] ), 0, 5 ) );
}

It will generate a file for each load.php request (so you can inspect each of them separately and they don't end writing on the same log at the same time). The first line of the log should have the request URL so you can differentiate them. Still, it doesn't output many interesting things, and logs don't have timestamp. If that doesn't show anything useful, then you'll need to set up profiling. Note that it requires a php extension that may not be available on your server, which may make that option not viable.

I added this to the code (inside the if) to enable it, after installing xhprof and creating the required database table:

    $wgProfiler = array(
        'class' => 'ProfilerXhprof',
        'output' => array( 'text', 'db' ),
        'perHost' => false,
    );
Silvernerd1 (talkcontribs)

Sorry for coming back to you so late ...

I created a directory called '/mis-files' with 777 rights directly under the root of my wiki and I added the following code an the end of LocalSettings.php

if ( isset( $_SERVER['SCRIPT_NAME'] ) && pathinfo( $_SERVER['SCRIPT_NAME'] )['basename'] == 'load.php' ) {
    $wgDebugRawPage = true;
    // Uncomment this line to see all SQL queries being done
    $wgDebugDumpSql  = true;
    // Adapt this path to a directory writable by the webserver
    $wgDebugLogFile = sprintf( '$IP/mis-files/loadphp-%s.log', substr( md5( $_GET['modules'] ), 0, 5 ) );
}

Unfortunately, nothing happens. The folder remains empty.

Ciencia Al Poder (talkcontribs)

You must change the single quotes in '$IP/mis-files/loadphp-%s.log' with double quotes, otherwise $IP won't be substituted by the real variable value

Subfader (talkcontribs)
Ciencia Al Poder (talkcontribs)

Yes, it seems a RL problem. Is there an opened phabricator task about this? That would be interesting

Subfader (talkcontribs)

I haven't started one tho.

Silvernerd1 (talkcontribs)

I asked my provider's support team to check this issue. They told me, that they checked my site at multiple times of day and that they couldn't find any performance problems.

Since then, I also don't have these problems any more. I suppose, they found the reason and fixed it.

Thank you four your support.

--

Bfn

Michael

Silvernerd1 (talkcontribs)
Reply to "Performance issues"