Is it a recurring issue with Flarum or does it only happen on a specific host ? This might be an issue with Flarum, in which case you should report it on GitHub (if it's not already reported !) and somebody will have a look at it.
If you want to try switching to memcached yourself you will have to dig into the source code. I'm not sure about Symfony skills, but you probably need some Laravel basics to change that ?
Note: maybe it's already implemented in Flarum, I have no idea ?