From f6cdc0487e044a22936086de88595bae21cc3b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A8=B1?= <1265578519@qq.com> Date: Mon, 30 Sep 2024 08:00:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E6=B3=A8=E5=BA=94=E8=AF=A5=E6=8E=A7?= =?UTF-8?q?=E5=88=B680%=E5=86=85=E5=AD=98=E4=BD=BF=E7=94=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 标注应该控制80%内存使用率 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5508c31..54c0b38 100644 --- a/README.md +++ b/README.md @@ -126,9 +126,9 @@ curl http://localhost:8080/stats * * * * * /sbin/pidof opentracker||{ cd /home/OpenTracker-master;cd opentracker;./opentracker -f opentracker.conf.sample -p 8080 -P 8080 -p 6961 -P 6961 -p 2710 -P 2710 &} ``` -方式三,推荐替换二,可以代替之前的pidof判断oom杀进程,毕竟触发oom的之前几分钟因为内存不足都无法新建tcp连接,ssh都上不去 +方式三,推荐替换二,可以代替之前的pidof判断oom杀进程,毕竟触发oom的之前几分钟因为内存不足都无法新建tcp连接,ssh都上不去(控制512M内存的80%是100000) ```markdown -* * * * * [ $(awk '/MemFree/ {free=$2} /Buffers/ {buffers=$2} /^Cached/ {cached=$2} END {print free + buffers + cached}' /proc/meminfo) -lt 102400 ] && { killall -9 opentracker;sleep 3;cd /home/OpenTracker-master;cd opentracker;./opentracker -f opentracker.conf.sample -p 8080 -P 8080 -p 6961 -P 6961 -p 2710 -P 2710 &} +* * * * * [ $(awk '/MemFree/ {free=$2} /Buffers/ {buffers=$2} /^Cached/ {cached=$2} END {print free + buffers + cached}' /proc/meminfo) -lt 100000 ] && { killall -9 opentracker;sleep 3;cd /home/OpenTracker-master;cd opentracker;./opentracker -f opentracker.conf.sample -p 8080 -P 8080 -p 6961 -P 6961 -p 2710 -P 2710 &} ```