Time zone
timedatectl set-timezone Asia/Hong_Kong
Firewall
firewall-cmd --permanent --add-port=31129-31130/tcp
firewall-cmd --reload
firewall-cmd --list-all
Enable BBR
Option 1
wget --no-check-certificate -O enable_bbr.sh https://github.com/teddysun/across/raw/master/bbr.sh
chmod +x enable_bbr.sh
./enable_bbr.sh
sysctl net.ipv4.tcp_available_congestion_control
sysctl net.ipv4.tcp_congestion_control
sysctl net.core.default_qdisc
lsmod | grep bbr
Option 2
wget --no-check-certificate https://raw.githubusercontent.com/jinwyp/one_click_script/master/install_kernel.sh && chmod +x ./install_kernel.sh && ./install_kernel.sh
Create the swapfile
fallocate -l 8G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon --show
If we want to change the size of swapfile, we need swapoff and recreate the file
swapoff /swapfile
rm -rf /swapfile
To make the change permanent open the /etc/fstab
file and append the following line:
/swapfile swap swap defaults 0 0
Remove rpcbind
systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl disable rpcbind
systemctl disable rpcbind.socket
Remove oracle-cloud-agent
systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater
Useful commands
top -o RES
```
This will display the processes sorted by the memory usage (RES field).
ps aux --sort -rss
```
This will list all processes sorted by the resident set size (RSS).
top -o %CPU
```
This will launch the top command and sort the processes by their CPU usage in descending order.
free -h
df -h
```
Human readable memory and disk consumption
docker stats --no-stream
Setup system cleanup and update
Refer to: Update, clean and reboot in CentOS 8