oracle甲骨文机器保活-锻炼

date
Feb 1, 2023
slug
tip-oracle-keepalive
status
Published
summary
小技巧
tags
tip
type
Post
URL

Problem & Summary

notion image

Solution 20230522 -

curl -L https://gitlab.com/spiritysdx/Oracle-server-keep-alive-script/-/raw/main/oalive.sh -o oalive.sh && chmod +x oalive.sh && bash oalive.sh
notion image
notion image

Solution 0 - tested (arm/amd通用)

mkdir data; cd /data
git clone https://github.com/velor2012/lookbusy-docker
cd lookbusy-docker
docker build . -t lookbusy

cat > start.sh <<EOF
/app/lookbusy/lookbusy -c 25-40 -r curve # 占用所有 CPU 核心在 25%-40% 左右浮动
#/app/lookbusy/lookbusy -c 25-40 -r curve -n 2 # 占用两个 CPU 核心各 25-40% 左右浮动
#/app/lookbusy/lookbusy -c 0 -m 128MB -M 1000 # 每 1000 毫秒,循环释放并分配 128MB 内存
/app/lookbusy/lookbusy -c 0 -m 512MB -M 1000 # 每 1000 毫秒,循环释放并分配 512MB 内存
/app/lookbusy/lookbusy -c 0 -d 1GB -b 1MB -D 10 # 每 10 毫秒,循环进行 1MB 磁盘写入,临时文件不超过 1GB
EOF

docker run -d --name lookbusy --restart=always -v $(pwd)/start.sh:/app/start.sh lookbusy
docker logs lookbusy
top
 

Solution 0.1 网络问题

AMD

apt install -y wget screen 

mkdir -p /data/NeverIdle
cd /data/NeverIdle && wget https://github.com/layou233/NeverIdle/releases/download/0.1/NeverIdle-linux-amd64 -O NeverIdle && chmod 777 NeverIdle

screen -R baohuo
./NeverIdle -c 2h -n 2h # 启动程序

ARM

apt install -y wget screen && wget https://github.com/layou233/NeverIdle/releases/download/0.1/NeverIdle-linux-arm64 -O NeverIdle && chmod 777 NeverIdle

screen -R baohuo
./NeverIdle -c 2h -m 1 -n 2h
其中:

-c 指启用 CPU 定期浪费,后面跟随每次浪费的间隔时间。
如每 12 小时 23 分钟 34 秒浪费一次,则为 12h23m34s。按照格式填。

-m 指启用浪费的内存量,后面是一个数字,单位为 GiB。
启动后会占用对应量的内存,并且保持不会释放,直到手动杀死进程。

-n 指启用网络定期浪费,后面跟随每次浪费的间隔时间。
格式同 CPU。会定期执行一次 Ookla Speed Test(还会输出结果哦!)

# 挂起screen 按 Ctrl+A+D

#再次进入screen 
screen -R baohuo

Solution 1


# https://hostloc.com/thread-1131732-1-1.html
curl https://keeporacle.pages.dev/ -o keeporacle.sh && chmod +x keeporacle.sh && ./keeporacle.sh
notion image

Solution 2

# https://hostloc.com/thread-1131769-1-1.html
apt install bc -y && apt install cpulimit -y

crontab -e
@reboot nohup cpulimit -l 20 bash -c "while :;do a=1;done" > /dev/null 2>&1 &

https://51.ruyo.net/18289.html

notion image

© Ying Bun 2021 - 2024