Hardware and performance

File vs Database for Sessions, moodle 3.3

 
Picture of Paul L
File vs Database for Sessions, moodle 3.3
 

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

 
Average of ratings: -
Picture of Howard Miller
Re: File vs Database for Sessions, moodle 3.3
Core developersDocumentation writersParticularly helpful MoodlersPlugin 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.

 
Average of ratings: Useful (1)
Picture of Matteo Scaramuccia
Re: File vs Database for Sessions, moodle 3.3
Core developersParticularly helpful MoodlersPlugin 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

 
Average of ratings: Useful (5)
Picture of Chris Fryer
Re: File vs Database for Sessions, moodle 3.3
 

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

 
Average of ratings: Useful (2)
Picture of Paul L
Re: File vs Database for Sessions, moodle 3.3
 
thanks Ill switch from DB to File for sessions and look into Redis for WIndows.
 
Average of ratings: -
You either love it or you hate it
Re: File vs Database for Sessions, moodle 3.3
Particularly helpful Moodlers

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 smile

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

 
Average of ratings: -
Picture of Paul L
Re: File vs Database for Sessions, moodle 3.3
 

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

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

 
Average of ratings: -