[module] Clear memory ram

Started by pedromidiasf, April 08, 2015, 07:44:19 PM

Previous topic - Next topic

pedromidiasf

This helps you to clear your memory ram avoiding your server to overload.





Add this line to:
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php
Quote<li><a href="index.php?module=clear_memory_ram"><span class="icon16 icomoon-icon-arrow-right-3"></span>Clear memory ram</a></li>


Then create a new file called "clear_memory_ram.php" on:
/usr/local/cwpsrv/htdocs/resources/admin/modules
with this content:

Quote<?php
exec('sync; echo 3 > /proc/sys/vm/drop_caches');
echo "Done!!";
?>

pedromidiasf

I also recommend you to restart apache after this, it'll increase your server status :)

subzeros

With the latest version this centos web panel /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php the file does not exist :(

pedromidiasf


neoart

Off corse, just create a 3rdparty.php and paste the code. :D

Quote from: subzeros on July 13, 2015, 07:47:45 PM
With the latest version this centos web panel /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php the file does not exist :(

Sandeep


pedromidiasf

At this moment, CWP already has this feature on it

Darkroom

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

This alone is  not recommended for production servers. at least stop mysql before you do this and then start is after. If any service tries to write to disk between the sync and the echo it's gone.