Purge cache for multi nginx server

Purge cache for multi nginx server

by Son TRAN -
Number of replies: 4

Dear All,

I host a Moodle server with 2 nginx servers in load balancing mode, the cache is in the mysql server, the moodle-data is in an NFS server. IF I need to purge cache, do I need to Purge cache for each nginx server one after the other:  turning off server A, purging cache for server B, then turning  off server B, turning on server A, purging cache for server A, finally turning on server B.

Or I just simply purging cache while both server are on?

Many thanks    

Average of ratings: -
In reply to Son TRAN

Re: Purge cache for multi nginx server

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You need to explain what "the cache is in the mysql server" means. Moodle makes use of all sorts of caches, from files (directories) in the nodes and shared to cache stores (Memcache(d), Redis, ..).

N.B. The topic clustering was traditionally in the Hardware and performance forum. or in A new "Large scale Moodle deployment" support group.
In reply to Son TRAN

Re: Purge cache for multi nginx server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Moving to Hardware and performance.

Yeh - I've never heard of caching using the database so you're going to have to explain your setup.
In reply to Howard Miller

Re: Purge cache for multi nginx server

by Son TRAN -
Dear @Visvanath Ratnaweera and @Howard Miller
Thank you for your feedback.
In fact I just save session to DB by setting "$CFG->session_handler_class = '\core\session\database';". Other types of moodle cache remain intact.
So in such a case like that , how can I purge the cache ? once for both nginx servers or one for each nginx separately ?
Many thanks
In reply to Son TRAN

Re: Purge cache for multi nginx server

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Don't use database sessions for live Moodle. It completely kills your database performance. Just the default files are better. Redis is better still.

Sessions are nothing to do with caching.