• After quite some debugging I set slow logs for PHP-FPM and it turns out that session_start() in model/namaste-model.php:301 is blocking the loading of the page for 10 seconds or even more. It doesn’t happen every time, but most often it happens when visiting wp-admin/edit.php?post_type=page

    Here is the slow log result:

    [28-Feb-2015 21:31:28] [pool web3] pid 20903
    script_filename = /var/www/clients/client2/web3/web/wp-admin/admin-ajax.php
    [0x00007f8593b90040] session_start() /var/www/clients/client2/web3/web/wp-content/plugins/namaste-lms/models/namaste-model.php:301
    [0x00007fffd4675020] init() unknown:0
    [0x00007f8593b8f608] call_user_func_array() /var/www/clients/client2/web3/web/wp-includes/plugin.php:496
    [0x00007f8593b8b800] do_action() /var/www/clients/client2/web3/web/wp-settings.php:353
    [0x00007f8593b8b3a8] +++ dump failed

    After some research I came to the conclusion, that it would be best if session_start() is used only directly before messing with $_SESSION and using session_write_close() right after it.

    I was about to make a patch for the plugin, but it turns out that currently the values that are set in $_SESSION (check models/homework-model.php) are being used in a function, that is never called – namaste_display_alerts() in helpers/htmlhelper.php:145.

    Will you please check what’s the case with the $_SESSION variable that is being defined (‘namaste_flash’) and if this is some legacy code that is to be removed? Currently I’m fixing the issue with just commenting the session_start() line, but would be happy to see (or make?) a fix for this in the next minor update 🙂

    https://wordpress.org/plugins/namaste-lms/

Viewing 1 replies (of 1 total)
  • Plugin Author Bob

    (@prasunsen)

    Thanks vloo, I’ll need to check it. It’s possible that the session_start() call is not currently required at all.

Viewing 1 replies (of 1 total)
  • The topic ‘session_start() slows down loading of some admin pages’ is closed to new replies.