Moodle 2.4.1 "Timed out while waiting for session lock"

Moodle 2.4.1 "Timed out while waiting for session lock"

by Dr. Nellie Deutsch -
Number of replies: 8

I've been usng Moodle since 2003 because I loved it, until 2.4.1. I'm not able to do anything anymore. I get timed out because the Moodle is so slow (see image). No one is able to resolve it. So, do I give up on Moodle after all these years? 

(Split from the thread "poor performance for logged in users" https://moodle.org/mod/forum/discuss.php?d=222627. Edited by Visvanath Ratnaweera - original submission Friday, 1 March 2013, 5:10 PM)

Attachment slow so get timed out.png
Average of ratings: -
In reply to Dr. Nellie Deutsch

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Derek Chirnside -

Nellie, I am not sure what to say.

There are a combination of factors.  RAM.  Space for temp file storage.  Time out settings and other settings in the config.  Your internet speed.  What you are trying to do.

Fact: Moodle 2.4 takes more resources than 1.9.  Obvious, it has more power.

Fact: hundreds of people have made the change and are OK, with pain in some cases, without pain in others.  So, no, you don't need to abandon Moodle.

Now comes the grey area.  I am sure you have posted elsewhere. Shared hosting or VM?  Standard install or do it yourself?  Serfver specs?  this is the information needed for gurus like Visvanath, Howard and Ken to be able to point in a direction.

And "I am not able to do anything anymore" - does thgis mean you cannot even log in?  If not, more detail needed.

Amateur advice: Start by doubling the RAM if you can.

-Derek.

In reply to Derek Chirnside

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Nellie,
another fact is that Moodle 2.4 is using DB-based sessions for several reasons and if you have a "poor" DB instance it should be wiser - balancing the drawbacks - to play with Moodle using file-based sessions.

HTH,
Matteo

In reply to Dr. Nellie Deutsch

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Ken Task -
Picture of Particularly helpful Moodlers

While using DB for session information should be best, when issue like session locks rear their ugly head (which is a problem not just to Moodle, BTW), found it easier to deal with them by using file based sessions.  The session files are kept in /moodledata/sessions/ and one can manually remove all files contained therein.  If you are logged on at the time of removal (or anyone is logged on), it will log you out on your next click.

As an admin level user, your session setup contains much more data than others.

Then, there is the 'other end' - browsers.  One way to remotely assist students without having to provide directions, etc, is to simple change the Cookie prefix in Session Handling config of the server.

While the purpose of that cookie prefix is primarily for admins/teachers that work in two Moodle instances served by the same server, it does apply to all who access.

'spirit of sharing', Ken

In reply to Dr. Nellie Deutsch

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Martin Sweeney -

Nellie, have you found any solutions? I'm having the same problem and cannot find any solution here are elsewhere (including my host server, Laughing Squid).

Marty

P.S. Love your work with WizIQ

In reply to Martin Sweeney

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This turned out to be a bug in the messaging system (MDL-38536). Nellie's site has thousands of stored messages (about 330K if I recall) and the tables that store them are not properly indexed. The issue was (well is) that the site times out trying to display the messaging pop up.

I would have thought that this was quite a specific issue. However, it only takes two seconds to switch off messaging (Advanced settings) and see.

In reply to Howard Miller

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Martin Sweeney -

Thanks Howard. My site is new without any messages so I'm still confused how 2.4 can run soooooo-slowly as Admin. At these speeds, it almost rules 2.4 as an option. 15-60 seconds to move from page to page, let alone adding and editing content. I'll keep plugging away for awhile longer.

Marty

In reply to Martin Sweeney

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You need to find out what's going on... these are the things that I usually start with. I've not given much detail but all are google-able or you can ask if you need to.

- Enable the MySQL slow query log and check it
- Run YSlow or something like it in Frefox/Firebug
- Monitor the load (try munin) on your server and/or watch 'top' while serving Moodle pages.

The likely problems could be...

- running out of memory full stop or some part of the system running out of memory allocated to it. The killer is if the server starts swapping to disk
- something wrong in the sql server. Queries taking a long time
- something else - some process using excessive resources

In reply to Martin Sweeney

Re: Moodle 2.4.1 "Timed out while waiting for session lock"

by Ken Task -
Picture of Particularly helpful Moodlers

@ Martin ...

Wonder if your situation is different:  Rackspace Cloud Services via hosting provider.

https://laughingsquid.us/faq/general/#compute-cycles

"There is not currently a way to cap cpu cycles or disk space, so if you are concerned about going over the limit you will need to monitor your cpu cycles closely. Your compute cycle statistics are available to you in near real time from your control panel. In addition we are happy to assist you in locating any problems causing you to use excessive cycles, just submit a support ticket through our Help Desk."

'spirit of sharing', Ken