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!

Cache was eating up my free ram causing scripts not to run, this was my fix

Discussion in 'Workarounds and Optimization' started by tkrn, Jan 18, 2010.

  1. tkrn

    tkrn Registered

    Jan 12, 2010
    Likes Received:
    Trophy Points:
    I created a script and had the following in it

    sync; echo 3 > /proc/sys/vm/drop_caches
    Then manually put it in the root's cron job at /var/spool/cron/root to run every 10 minutes, I experimented with a few other values and found the 10 minute cron job was a good time.

    Now my system runs with 150-256mb physical ram free at any given moment giving enough memory to scripts and other memory intensive services that need it more than cache. Before I did this, I would often have 12-25 MB of free physical ram which caused a whole bunch of issues.

    Let me know if any body else has results from this as well.

    Original credits to Linux: How To Clear The Cache From Memory
  2. ModServ

    ModServ Well-Known Member

    Oct 17, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    When I do that, It makes the server that has just been rebooted and suffer from high load as the visitors start to work on those sites again, Just like apache restart but after some minutes the load becomes normal again. I think that if you restart httpd and mysql you will get results near from drop caches.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice