/var/cache : which is the better way to handle it on HA scenario?

Status
Not open for further replies.

chrisbware

New Member
Apr 17, 2018
27
2
3
Italy
chrisbware.wordpress.com
Hi guys,

I'd like to know if it's possible to disable configuration caching by fusion, since it seems not easy to handle. I often need to flush cache manually on the other nodes of my cluster.
Is there a better way to do it?
How can I disable caching ?


Thanks in advance for your answer

Regards
 

ad5ou

Active Member
Jun 12, 2018
892
205
43
Removing the cache will hurt call processing performance.
You could set a cron job to automatically clear the cache at set intervals but I’ve found the best practice is to login to the node a particular domain is on when making changes especially if the changes will require clearing the cache.
 

chrisbware

New Member
Apr 17, 2018
27
2
3
Italy
chrisbware.wordpress.com
A cron job doesn't fix it. What would be needed is a resource able to delete previous file on cache or update it, according to what you do in web interface.
I don't understand how is possible that none had the same issue before.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
505
180
43
50
File cache works great. I wouldn't use memcache as it doesn't scale as well does until your server load gets too high then it can't keep up. There are multiple ways to work with the it on a cluster ad5ou mentioned one.
 

kt351b

Member
Feb 24, 2020
33
1
6
25
File cache works great. I wouldn't use memcache as it doesn't scale as well does until your server load gets too high then it can't keep up. There are multiple ways to work with the it on a cluster ad5ou mentioned one.
What way to work with cache in a "cluster mode" can you recommend?
 

djacob

Member
Oct 31, 2016
43
8
8
51
Bensalem PA , USA
A cron job doesn't fix it. What would be needed is a resource able to delete previous file on cache or update it, according to what you do in web interface.
I don't understand how is possible that none had the same issue before.
have you tried using /usr/share/freeswitch/scripts/ha_monitor.lua?

what did you wind up doing?
 

markjcrane

Active Member
Staff member
Jul 22, 2018
505
180
43
50
A cron job definitely works to clear files at any age of your choosing. 1 minute - 15 minutes, one hour or whatever term you would like. So if you changes are ready after 1 minute on any other server Memcache does that and its not that hard to do that with a cron job for a file cache.

Memcache
- less secure
- uses TCP slower to connect and disconnect than the file system
- dependent on socket listeners that can get overwhelmed
- cache is harder to view

File cache
- files can be replicated or synced to multiple servers
- scales really well - think about file system caches
- cron job can be used to expire cache like memcache
- easy to look at the cache

The move to file cache had good reasons and was completed to solve scalability problems for one of FusionPBX's largest customers. So if your customer can put up with 1 minute, 3 minutes or 5 minutes you can clear the file cache by age after that time frame. If you want instant then you would need to use replication or some other means to clear the cache.
 
Last edited:

djacob

Member
Oct 31, 2016
43
8
8
51
Bensalem PA , USA
A cron job definitely works to clear files at any age of your choosing. 1 minute - 15 minutes, one hour or whatever term you would like. So if you changes are ready after 1 minute on any other server Memcache does that and its not that hard to do that with a cron job for a file cache.

Memcache
- less secure
- uses TCP slower to connect and disconnect than the file system
- dependent on socket listeners that can get overwhelmed
- cache is harder to view

File cache
- files can be replicated or synced to multiple servers
- scales really well - think about file system caches
- cron job can be used to expire cache like memcache
- easy to look at the cache

The move to file cache had good reasons and was completed to solve scalability problems for one of FusionPBX's largest customers. So if your customer can put up with 1 minute, 3 minutes or 5 minutes you can clear the file cache by age after that time frame. If you want instant then you would need to use replication or some other means to clear the cache.
Mark,

Thank you for explaining that. I will be in touch soon.

Thanks
Dave
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,072
577
113
With regards to switching of the cache, I would seriously think far more than twice about doing that.

The amount of DB lookups the cache saves is amazing.

You might also want to get it into some form of RAM disk too.
 
Status
Not open for further replies.