Control Web Panel

Developers => New Modules => Topic started by: pedromidiasf on April 08, 2015, 07:44:19 PM

Title: [module] Clear memory ram
Post by: pedromidiasf on April 08, 2015, 07:44:19 PM
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!!";
?>
Title: Re: [module] Clear memory ram
Post by: pedromidiasf on April 28, 2015, 12:23:56 PM
I also recommend you to restart apache after this, it'll increase your server status :)
Title: Re: [module] Clear memory ram
Post by: 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 :(
Title: Re: [module] Clear memory ram
Post by: pedromidiasf on December 11, 2015, 01:26:32 AM
What do you mean? I don't get it
Title: Re: [module] Clear memory ram
Post by: neoart on June 22, 2016, 07:56:20 PM
Off corse, just create a 3rdparty.php and paste the code. :D

 
With the latest version this centos web panel /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php the file does not exist :(
Title: Re: [module] Clear memory ram
Post by: Sandeep on June 23, 2016, 03:43:58 AM
Useless for openvz
Title: Re: [module] Clear memory ram
Post by: pedromidiasf on June 23, 2016, 02:31:02 PM
At this moment, CWP already has this feature on it
Title: Re: [module] Clear memory ram
Post by: Darkroom on October 22, 2017, 02:46:53 AM
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.