Skip to content

Commit

Permalink
更新说明,标注75%为125M,1G为250M,加入其它系统打开文件优化和一个可选优化
Browse files Browse the repository at this point in the history
更新说明,标注75%为125M,1G为250M,加入其它系统打开文件优化和一个可选优化
  • Loading branch information
1265578519 committed Oct 16, 2024
1 parent 07a2d2e commit e7a7e30
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 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都上不去(控制512M内存的80%是100000
方式三,推荐替换二,可以代替之前的pidof判断oom杀进程,毕竟触发oom的之前几分钟因为内存不足都无法新建tcp连接,ssh都上不去(控制512M内存的75%是125000,1G内存的75%是250000,避免超过80%
```markdown
* * * * * [ $(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 &}
* * * * * [ $(awk '/MemFree/ {free=$2} /Buffers/ {buffers=$2} /^Cached/ {cached=$2} END {print free + buffers + cached}' /proc/meminfo) -lt 125000 ] && { 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 Expand Up @@ -214,3 +214,9 @@ lsof -n | awk '{ print $2; }' | uniq -c | sort -rn | head
cat /proc/28492/limits | grep files
```
虽然实际上ulimit限制显示是1024,但是Linux应该是用4字节作为计算,也就是4124达到阈值,修改打开文件后就可以突破4124,修改成功后两个数值都会显示为1048576

如果你用的是其他操作系统,Debian系统设置limits打开文件
https://bbs.itzmx.com/thread-110212-1-1.html

一个可选内存优化,禁用AnonHugePages释放更多可用内存给予进程
https://bbs.itzmx.com/thread-110231-1-1.html

0 comments on commit e7a7e30

Please sign in to comment.