Purge cache for multi nginx server

Purge cache for multi nginx server

von Son TRAN -
Anzahl Antworten: 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    

Als Antwort auf Son TRAN

Re: Purge cache for multi nginx server

von Visvanath Ratnaweera -
Nutzerbild von Particularly helpful Moodlers Nutzerbild von 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.
Als Antwort auf Son TRAN

Re: Purge cache for multi nginx server

von Howard Miller -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von 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.
Als Antwort auf Howard Miller

Re: Purge cache for multi nginx server

von 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
Als Antwort auf Son TRAN

Re: Purge cache for multi nginx server

von Howard Miller -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von 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.