Author Topic: [module] Clear memory ram  (Read 19548 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
[module] Clear memory ram
« 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!!";
?>

Offline
**
Re: [module] Clear memory ram
« Reply #1 on: April 28, 2015, 12:23:56 PM »
I also recommend you to restart apache after this, it'll increase your server status :)

Offline
*
Re: [module] Clear memory ram
« Reply #2 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 :(

Offline
**
Re: [module] Clear memory ram
« Reply #3 on: December 11, 2015, 01:26:32 AM »
What do you mean? I don't get it

Offline
*
Re: [module] Clear memory ram
« Reply #4 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 :(

Offline
*****
Re: [module] Clear memory ram
« Reply #5 on: June 23, 2016, 03:43:58 AM »
Useless for openvz

Offline
**
Re: [module] Clear memory ram
« Reply #6 on: June 23, 2016, 02:31:02 PM »
At this moment, CWP already has this feature on it

Offline
*
Re: [module] Clear memory ram
« Reply #7 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.