Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running drop_caches daily on production server

Discussion in 'Workarounds and Optimization' started by caisc, Feb 10, 2017.

  1. caisc

    caisc Well-Known Member

    Joined:
    Oct 5, 2011
    Messages:
    70
    Likes Received:
    2
    Trophy Points:
    58
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Is it good idea to run drop_caches on a production server daily via cronjob in off peak hours?

    sync; echo 3 > /proc/sys/vm/drop_caches

    I understand that it will clean up all cache but the free memory will speed up things and overall performance of server.

    What do experts say about this

    Thanks
     
  2. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    604
    Likes Received:
    94
    Trophy Points:
    103
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    No, this is not wise. You're basically dropping everything from the memory cache. Linux keeps the caches full 99% of the time so it doesn't have to keep reading the disk.

    Having 'free' memory will not speed up performance, it will actually make it worse because the kernel will have to read the disk now for things that you've dropped from the caches.

    Help! Linux ate my RAM!
     
    eva2000 likes this.
  3. caisc

    caisc Well-Known Member

    Joined:
    Oct 5, 2011
    Messages:
    70
    Likes Received:
    2
    Trophy Points:
    58
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Apart from increased Disk usage is there any other drawback? I use SSD on my server so dont think it will be a issue for me.

    @cPJacob why I asked this -

    I have noticed that by default 99% RAM is utilised by Linux, now with RAM filled up with cache suppose I need to restart CXS scanner that will watch all the accounts on server one by one. with cache in ram this process sometimes takes 6 hours.

    Now If I clear cache and restart CXS it completes same task in 30 mins.

    CXS watch cycle is a resource intensive process and if it goes on for 6 hours its further slow down the server, so I think its better complete the task quickly and let RAM fill up again with cache in due process.

    Having SSD very much compensates the increased disk I/O

    What do you say?
     
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,615
    Likes Received:
    51
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    the draw back is you will wear out your disk faster
    But you are probably doing it anyway running csx.


    I would suspect that you do not have enough free ram to run csx and its using the swap
    since you said 99% is cached



    I don't use csx so I do not know ho much memory its uses
    But its cousin maldet uses about 200M- 800M with Clamscan

    if you could add more Ram so you have plenty free
    the slow scan time would go away
     
Loading...

Share This Page