Memcache won't flush or clear memory

前端 未结 5 1435
天命终不由人
天命终不由人 2021-02-19 10:19

I\'ve been trying to clear my memcache as I\'m noticing the storage taking up almost 30% of server memory when using ps -aux.

So I ran the following php co

5条回答
  •  广开言路
    2021-02-19 10:48

    You need to wait atleast 1 second after clearing memcache. otherwise items added less than one second will invalidate itself.

    Ex:

    $memcache->flush();
    
    $time = time()+1; //one second future
    while(time() < $time) {
    //sleep
    }
    $memcache->set('key', 'value'); // repopulate the cache 
    

    Look at this post, memcache flush issue

提交回复
热议问题