甲骨文保持占用

50次阅读

共计 1346 个字符,预计需要花费 4 分钟才能阅读完成。

内容最后由 sesr 于 2023-2-1 14:40 编辑 cat > /etc/systemd/system/KeepCPU.service <<EOF[Unit][Service]CPUQuota=40%ExecStart=/usr/bin/python3 /tmp/cpu.py[Install]WantedBy=multi-user.targetEOFcat > /tmp/cpu.py <<EOFwhile True:  x=1EOFcat > /etc/systemd/system/KeepMemory.service <<EOF[Unit]ConditionArchitecture=arm64[Service]CPUQuota=1%ExecStart=/usr/bin/python3 /tmp/memory.py[Install]WantedBy=multi-user.targetEOFcat > /tmp/memory.py <<EOFarray = bytearray(2576980378) # 2.4G (10% of 24G)while True:  x=1EOFcat > /etc/systemd/system/KeepNetwork.service <<EOF[Unit]After=network-online.target[Service]ExecStart=/tmp/network.sh[Install]WantedBy=multi-user.targetEOFcat > /tmp/network.sh <<EOF#!/usr/bin/env bashwhile true; do  curl -s -o /tmp/test.out –limit-rate 1M  http://cachefly.cachefly.net/100mb.testdoneEOFchmod +x /tmp/network.shsystemctl daemon-reloadsystemctl enable KeepCPU –nowsystemctl enable KeepMemory –nowsystemctl enable KeepNetwork –now 复制代码以上是 Arm(4 核 24G) 的模版,如果是 Amd(2 核 1G) CPUQuota=20% 大炮 2023-02-01 14:44 2 羡慕有号的大佬。惜为伊人醉 2023-02-01 14:45 3 大佬牛啊,前排支持一下 sunlight 2023-02-01 14:47 4 很好,一周后取消政策,期间使用率飙升的全部封掉? mhsl 2023-02-01 14:49 5mark 一下 hoshino 2023-02-01 14:49 6 政策随时会变 这种的没啥用 Paradox0s 2023-02-01 14:56 7 你都放 /tmp,重启不是没了?sesr 2023-02-01 15:04 8Paradox0s 发表于 2023-2-1 14:56 你都放 /tmp,重启不是没了?只提供一个比较极简的思路,每个人系统不一样 花样 2023-02-01 15:16 9sesr 发表于 2023-2-1 15:04 只提供一个比较极简的思路,每个人系统不一样大部分人都没思路,只会复制粘贴,比如我? zymsdf 2023-02-01 15:24 10 两个机制 CPU 和网络。含网络吗~~

正文完
 0