Skip to content

VictorFDiniz/AutoClean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Languages: Português-br, English

auto

Install command for CentOS, Debian and Ubuntu

wget -c -P $HOME https://raw.githubusercontent.com/VictorFDiniz/CacheAutoClean/main/install.sh; cd $HOME; chmod +x install.sh; ./install.sh

About this script

If you have a server that doesn't have enough RAM, crashes frequently, and you don't have the budget for an upgrade, this script can help you! You can set a limit value for RAM usage. If the value is reached, the script automatically clears the cache allocated in RAM to prevent the server from crashing. It's also possible to configure Swap memory via Swappiness to alleviate RAM usage when it reaches a certain threshold.

There are three cleaning options:

auto02

Clearing the cache in production environments may not be a good idea. But if you still decide to use the script in your production environment, the first option (PageCache clearing) is the safest.

auto03

Or just skip and go straight to the swappiness configuration.

Commands

Usage: autoclean <command> [value]

Commands:

cachecln <value> Set cache clean level (1-3)
ramtrig <value> Set RAM trigger value (5-90)
swppns <value> Set swappiness value (0-100)

Examples:

autoclean cachecln 1
autoclean ramtrig 45
autoclean swppns 27

Or pass multiple arguments:

autoclean cachecln 2 ramtrig 34 swppns 37

Additional commands:

autoclean stop, stop the script
autoclean start, start the script if stopped
autoclean restart, restart the script
autoclean remove, remove the script

About

Automate the RAM cleaning process on CentOS, Debian and Ubuntu.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages