what's the normal size of session table?

what's the normal size of session table?

by susan cheng -
Number of replies: 4

Hi All,

Our website (Moodle 2.4) gets problem recently, the main issue is during the exam period(over 1000 students), performance is slow, sometime even disconnected. When tracking the process list meanwhile, found many of queries most of them shows

"SELECT GET_LOCK("...session-33333,120)  or

UPDATE mdl_session SET state='' .

Now I have just found out the session table is only 5000 rows, is this normal? I would assuming the session table seems very small.

Could anybody give me some advice?

Attachment session.JPG
Average of ratings: Useful (1)
In reply to susan cheng

Re: what's the normal size of session table?

by Ken Task -
Picture of Particularly helpful Moodlers

One can set sessions to be file based as opposed to using DB inside the Moodle Admin UI.

Once that is done, a 'sessions' folder should appear in your moodledata folder/directory and Moodle will use that folder/directory to record session information.  Means fewer hits/etc. on DB and could, depending, speed things up upon login and one might experience fewer issues with testing/quiz as a result.

As far as disconnects ... might check into your DB settings via mysqltuner.pl or similar script for optimizing the DB.   As far as testing is concerned, that's one of the heavy usage areas.   Have read that some folks even limit the number of questions per page, etc.. in attempts to prevent 'disconnects' and 'slowness'.

On those disconnects ... does apache error log or mysql log show anything that might provide a clue?

'spirit of sharing', Ken

In reply to susan cheng

Re: what's the normal size of session table?

by Ken Task -
Picture of Particularly helpful Moodlers

Strange ... got your 'help me out' posting via EMail but it doesn't seem to be appearing here - 'feature'?

Am trying to help out!  You've asked if the number of rows is 'normal' in mdl_sessions.   Not sure one could determine 'normal' with any Moodle implementation for much depends upon what's provided on the site and usage.

Said the site was slow and sometimes non-reponsive.   Site is in need of inspection to find out why it's slow ... many factors there ... offered some suggestions concerning.   One suggestion deals directly with the 'sessions' issue - simply don't use the DB for sessions - use file.

'spirit of sharing', Ken

In reply to Ken Task

Re: what's the normal size of session table?

by susan cheng -

Hi Ken,

Thanks for your attention.

Please forgive me reply you late. We were just replicated this issue on our staging server, one person just keep click a "review" link very fast, and it generated more than 200 connections on the processlist. Most of them are GET_LOCK session queries with same session id.The bandwidth and CPU usage were also very high(60%) (note, there were only 5 users online) but other people didn't feel slow down at the moment.

But the days ago when the issue happened on live server there were more than 120 courses hit the deadline, although we didn't feel the site slow down when we testing but with such amount students online could be different.

Meanwhile we also tested it on our Moodle 1.9 live site (we have two sites, 2.4 and 1.9) and didn't fine this high session update.

For your suggestion to save the session in file, we will think about it. But at least now we can't do any change since there are big amount users are using it.

About the "help me out" email you got, I didn't send out any email, this is wired.

 

Thank you.

Susan

 

In reply to susan cheng

Re: what's the normal size of session table?

by Serg Tolpygin -

i have the same problem. exist solution?


I have user with many messages(20 000) .. and when i wonna se his messages i have been waiting for timeout -120 sec and then disconnected waiting session block.