Clear / Flush cached memory
        Posted  
        
            by 
                TheDave
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by TheDave
        
        
        
        Published on 2012-10-07T08:30:42Z
        Indexed on 
            2012/10/07
            9:40 UTC
        
        
        Read the original article
        Hit count: 349
        
I have a small VPS with 6GB RAM hosting a couple of websites.
Recently I have noticed that my cached memory size is quite high - see below:
    Cpu(s):  0.1%us,  0.1%sy,  0.0%ni, 99.1%id,  0.0%wa,  0.2%hi,  0.4%si,  0.0%st
    Mem:   6113256k total,  5949620k used,   163636k free,   398584k buffers
    Swap:  1048564k total,      104k used,  1048460k free,  3586468k cached
After investigating if there is some method to have this flushed or cleared I stumbled upon a command which is:
    sync; echo 3 > /proc/sys/vm/drop_caches
I read it could be useful to add this to a chron-task/job. Is this method recommended or could this lead to potential problems?
The only concern I have is that I use one Magento installation on Memcached - could this have any negative effects on it?
I am certainly not a pro therefore I would very much appreciate some expert advise.
PS: My VPS runs on CentOS 5 x64 and I have WHM + NGINX installed.
© Server Fault or respective owner