I just can't figure it out, where my configuration goes wrong, since I get so many misses and so few hits. And eventually that causes memory leaks.
See yourself. Notice that I'm using APCu rather than APC.
https://i.stack.imgur.com/3DPxo.png
Do you have any ideas of what I might be doing wrong, or what goes wrong?
Yes, I am aware of the following question and answer: APC Hits/Misses and configuration. Yet, after many tries of tweaking configuration, I can't still understand why so many misses.
I have a simple meta search app, where all the results from searches, are cached with APC. The following code, is a demonstration of how I process such data.
$dynamic_variable = "query_{$query}_page$this->page"; // This is just one case of many.
// Get Data from Cache
$cache_variable = "api1_{$dynamic_variable}_cached";
$result = $this->cache->get($cache_variable);
if ( ! $result) {
$result = .....
$this->cache->save($cache_variable, $result, $this->cache_timeout);
}
return $result;
And just to mention it, the app is currently using CodeIgniter 2.1.4, and migrating to https://github.com/ellislab/codeigniter/tree/release/3.0.