It is no secret my love for Memcached. Memcached is this incredible caching daemon that allows you to save data on a non-persistent medium. As a consequence, the use of Memcached will save unnecessary I/O and CPU processing. However, one of the most challenging things to deal with is the key management and an easy way to allow non-memcached aware software to take advantage of.
Neighter is secret my dislike for the "new" FusionPBX file caching engine. Its lack of expiring objects, the refusal of my PR to add that capability and its hardcode coding to only be local makes the syncing of cluster nodes, not an easy task.
I had the brilliant idea of using a Memcached FUSE filesystem to let the FusionPBX still use the file caching while taking advantage of the Memcached capabilities. After googling, I was able to find memcachefs which was working flawlessly in CentOS 7. I couldn't figure out a core dump after spending some time porting the libmemcache and compiling this software on RHEL 8 & 9 (Rocky Linux 8 and 9). RHEL 7 Linuxes come with Memcached 1.4, and RHEL 8 and 9 Linuxes come with Memcached 1.6; there are some differences in the protocol that the unmaintained libmemcached library is unaware of.
I found libmemcached (and its fork libmemcached-awesome) aware of the new Memcached 1.6 protocol. There are not enough examples about how to use this library, so I took the challenge of reading and doing the porting of the memcachedfs from Tsukasa Hamano. The result is the new MemcachedFS, a FUSE Filesystem that allows you to see the Memcached keys as files.
If you are a C developer familiar with libfuse and libmemcached, please send pull requests.
Enjoy!