Skip to content

Commit

Permalink
标注应该控制80%内存使用率
Browse files Browse the repository at this point in the history
标注应该控制80%内存使用率
  • Loading branch information
1265578519 committed Sep 30, 2024
1 parent 58f6cfd commit f6cdc04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 &}
```


Expand Down

0 comments on commit f6cdc04

Please sign in to comment.