File vs Database for Sessions, moodle 3.3

File vs Database for Sessions, moodle 3.3

Paul Lindgreen tomonidan -
Number of replies: 6

The default session is stored to disk

The following forum post suggest not using databases for busy site https://moodle.org/mod/forum/discuss.php?d=264600 My site has 5000 users and 300-500 logged on at any given time, would that be considered a busy site that should use file based session instead of our current database (mysql)?

I believe memcached is the preferred method for handling the sessions but I havent pursued it and wasnt certain how good windows 2008/2012 support was on this.

I was revisiting this as our test environment doesnt appear as fast as expected after a php 5.6->7.1 and moodle 3.1->3.3 upgrade, jmeter test show logging in and out among the slower processes. I like the fact sessions are preserved during web server IIS resets as our database is on another server, cant think of any other benefits though?

==

environment windows 2008/iis7.5/moodle3.3/mysql/php7.1

O'rtacha reytinglar: -
In reply to Paul Lindgreen

Re: File vs Database for Sessions, moodle 3.3

Howard Miller tomonidan -
Core developers rasmi Documentation writers rasmi Particularly helpful Moodlers rasmi Peer reviewers rasmi Plugin developers rasmi

If you are asking.... setup a proper cache for sessions (Redis is probably the best idea). 

File sessions are fine. Database sessions will give you all sorts of problems on a large site. It really burns up database resources.

In reply to Howard Miller

Re: File vs Database for Sessions, moodle 3.3

Matteo Scaramuccia tomonidan -
Core developers rasmi Peer reviewers rasmi Plugin developers rasmi

Hello Everyone,

File sessions are fine

That's actually true but in a single web server deploy: when you need to horizontally scale the web traffic w/ a load balancer it will also depend on the type of the file system being shared among the web nodes i.e. probably better to use Redis.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: File vs Database for Sessions, moodle 3.3

Chris Fryer tomonidan -

+1 for Redis. We had great confidence in Memcached for Moodle 3.1 in PHP 5, but since PHP 7 and MDL-57477, that confidence has completely evaporated.

In reply to Howard Miller

Re: File vs Database for Sessions, moodle 3.3

Paul Lindgreen tomonidan -
thanks Ill switch from DB to File for sessions and look into Redis for WIndows.
In reply to Paul Lindgreen

Re: File vs Database for Sessions, moodle 3.3

Albert Ramsbottom tomonidan -

Is this a load balanced, clustered set up or is it a single server? If it is multi-node then it will need to be clustered anyway, regardless of file or DB sessions ( I think Tabassum

Interesting about file sessions and Redis, as I have been away for 18 months. Another post of that do not want to hijack a thread


Albert

In reply to Albert Ramsbottom

Re: File vs Database for Sessions, moodle 3.3

Paul Lindgreen tomonidan -

single server, Windows 2008. about to upgrade to new server windows 2012

...looked into Redis for Windows, doesn't look promising, not fully supported.