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.

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.

Share This Page