File vs Database for Sessions, moodle 3.3

File vs Database for Sessions, moodle 3.3

av Paul Lindgreen -
Antall svar: 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

Gjennomsnittlig vurdering: -
Som svar til Paul Lindgreen

Re: File vs Database for Sessions, moodle 3.3

av Howard Miller -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers

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.

Gjennomsnittlig vurdering:Useful (1)
Som svar til Howard Miller

Re: File vs Database for Sessions, moodle 3.3

av Matteo Scaramuccia -
Bilde av Core developers Bilde av Peer reviewers Bilde av Plugin developers

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

Gjennomsnittlig vurdering:Useful (5)
Som svar til Matteo Scaramuccia

Re: File vs Database for Sessions, moodle 3.3

av Chris Fryer -

+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.

Gjennomsnittlig vurdering:Useful (2)
Som svar til Howard Miller

Re: File vs Database for Sessions, moodle 3.3

av Paul Lindgreen -
thanks Ill switch from DB to File for sessions and look into Redis for WIndows.
Som svar til Paul Lindgreen

Re: File vs Database for Sessions, moodle 3.3

av Albert Ramsbottom -

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 smiler

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

Som svar til Albert Ramsbottom

Re: File vs Database for Sessions, moodle 3.3

av Paul Lindgreen -

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

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