spiritlhls / oracle-server-keep-alive-script Goto Github PK
View Code? Open in Web Editor NEW服务器资源占用脚本(甲骨文服务器保活脚本)(Oracle Server Keep Alive Script)
Home Page: https://ko-fi.com/spiritlhl
License: MIT License
服务器资源占用脚本(甲骨文服务器保活脚本)(Oracle Server Keep Alive Script)
Home Page: https://ko-fi.com/spiritlhl
License: MIT License
我的vm為方便管理, 可以 ansible 批量運行, [Oracle-server-keep-alive-script] 是否可以不用 interactive?
而最好 Oracle-server-keep-alive-script 能夠隨意更改名稱 以防 oracle 的agent 探查...
== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Authenticating as: Ubuntu (ubuntu)
Password: Failed to enable unit: Connection timed out
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'cpu-limit.service'.
Authenticating as: Ubuntu (ubuntu)
Password:
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to reload daemon: Access denied
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Authenticating as: Ubuntu (ubuntu)
Password: Failed to enable unit: Connection timed out
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'cpu-limit.service'.
Authenticating as: Ubuntu (ubuntu)
甲骨文要求更新了,以前是15%,现在利用率要大于 20%,作者大佬脚本也更新下吧20-25%比较合适了
CGroup: /system.slice/bandwidth_occupier.service
├─135540 /bin/bash /usr/local/bin/bandwidth_occupier.sh
├─135542 timeout 5s wget --tries=3 --spider http://lg-kie.fdcservers.net/10GBtest.zip
└─135543 wget --tries=3 --spider http://lg-kie.fdcservers.net/10GBtest.zip
一直连接超时,造成实例不跑流量
只安装了一个cpu占用,貌似无效
需要自定义带宽占用的设置吗? (y/[n])
使用默认配置,45分钟间隔,请求10分钟,请求速率为最大速度的20%
Failed to start bandwidth_occupier.timer: Unit bandwidth_occupier.timer not found.
Failed to enable unit: Unit file bandwidth_occupier.timer does not exist.
带宽限制安装成功 脚本路径: /usr/local/bin/bandwidth_occupier.sh
The bandwidth limit script has been installed at /usr/local/bin/bandwidth_occupier.sh
如题,不知调用是否可自动动态波动,看了下甲骨文后台,CPU及内存占用都是刚刚过线,有点过于太明显了。。
如何查看锻炼日志? 谢谢
昨天太晚了,已經眼花
今天檢查,其實昨天 caddy 服務確實是死了
今天升級 2023.03.06.12.44,一樣造成 caddy 服務死掉
Mar 06 14:22:30 o3 caddy[680623]: {"level":"info","ts":1678083750.0312257,"msg":"shutting down apps, then terminating","signal":"SIGTERM"}
Mar 06 14:22:30 o3 caddy[680623]: {"level":"warn","ts":1678083750.0321887,"msg":"exiting; byeee!! 👋","signal":"SIGTERM"}
Mar 06 14:22:30 o3 caddy[680623]: {"level":"info","ts":1678083750.0413914,"logger":"tls.cache.maintenance","msg":"stopped background certificate>Mar 06 14:22:30 o3 caddy[680623]: {"level":"info","ts":1678083750.0425074,"logger":"admin","msg":"stopped previous server","address":"localhost:>Mar 06 14:22:30 o3 caddy[680623]: {"level":"info","ts":1678083750.0425303,"msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
Mar 06 14:22:30 o3 systemd[1]: caddy.service: Succeeded.
Originally posted by @Lawlietr in #22 (comment)
同标题
不知道是否需要卸载!谢谢
很多都超出40%了
注意,如果你的机器DD过后甲骨文后台无资源监控,那么使用本套脚本很可能无济于事,这种情况的不要开issue了
提问的麻烦给出报错日志或者以下命令的查询截图
执行htop
或者top
截个图
cat /tmp/memory-limit.pid
cat /tmp/cpu-limit.pid
cat /tmp/bandwidth_occupier.pid
service cpu-limit status
service memory-limit status
service bandwidth_occupier status
执行这些查看安装的服务是否正常
不给出查询截图的无法修复任何问题
截图直接粘贴到问题中Github会自动上传,不需要别的图床
如果某个服务有异常,执行
journalctl -u 服务名称 -n 50
查询对应日志
比如
journalctl -u bandwidth_occupier -n 50
之前碰上一次脚本运行了,但网速不变,查看log发现一直卡在wget --spider这一步
交替时间间隔大一些有空闲期,占用比甲骨文的要求略高一些就好,避免过于激进鸡没保住号也让甲骨文收了。
我有三台機器,一台 ubuntu, 兩台 centos
今天更新後三台機器 web 都掛了
ubuntu 使用 caddy 2.x, centos 使用 caddy 1.x
三台機器 caddy 服務狀態都顯示正常
重啟 firewalld 無法解決
必須重啟 caddy service 才行
在更新前沒有這麼現象
1、关于带宽占用,能不能增加一个设置,就是在指定时间区间内才执行带宽占用,比如我白天的时候不怎么用服务器此时基本没有流量,这个时候脚本执行带宽占用规则就很好模拟了使用情况,但是夜晚的时候我就会使用服务器做代理,这个时候流量就起来了,这个时段暂停带宽占用,这个想法大佬能实现么?
2、这个项目我一直有关注着,非常好的项目(其实每天都会看看有没有更新),可是最近的更新都没写更新内容,这就有点失望哈哈哈哈
设置了自定义,怎么设都会有大流量进出,就算设10m带宽1小时一次,一天也会跑一两百g
能不能加一个一键更新的功能?
arm的宝塔,怎么用
我在编译固件时,cpu dd还在执行,亲,有空指点一下。
报错情况如下,前两项安装成功,安装到第三项时 报错
请问该如何解决?
谢谢!
需要限制带宽吗? ([y]/n): y
speedtest-cli not found, installing...
Installing speedtest-cli
Updating package management sources
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 2:37:46 ago on Fri Mar 10 09:44:00 2023.
No match for argument: speedtest-cli
Error: Unable to find a match: speedtest-cli
不支持该架构:aarch64
半夜不常用时间段 跑脚本?
Aug 28 10:39:09 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:39:09 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:40:12 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:40:12 kr3 bash[2832793]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:40:12 kr3 bash[2832793]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:40:12 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:40:12 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:41:12 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:41:12 kr3 bash[2832966]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:41:12 kr3 bash[2832966]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:41:12 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:41:12 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:42:12 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:42:12 kr3 bash[2833020]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:42:12 kr3 bash[2833020]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:42:12 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:42:12 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:43:18 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:43:18 kr3 bash[2833165]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:43:18 kr3 bash[2833165]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:43:18 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:43:18 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:44:20 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:44:20 kr3 bash[2833219]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:44:20 kr3 bash[2833219]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:44:20 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:44:20 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:45:24 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:45:24 kr3 bash[2833270]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:45:24 kr3 bash[2833270]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:45:24 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:45:24 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:46:24 kr3 systemd[1]: Started Bandwidth Occupier Service.
Aug 28 10:46:24 kr3 bash[2833347]: /usr/local/bin/bandwidth_occupier.sh: line 40: syntax error near unexpected token fi' Aug 28 10:46:24 kr3 bash[2833347]: /usr/local/bin/bandwidth_occupier.sh: line 40:
fi'
Aug 28 10:46:24 kr3 systemd[1]: bandwidth_occupier.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 28 10:46:24 kr3 systemd[1]: bandwidth_occupier.service: Failed with result 'exit-code'.
Aug 28 10:47:26 kr3 systemd[1]: Started Bandwidth Occupier Service.
有单独的卸载脚本或者停止命令吗?centos 7输入命令之后好像自动安装了,没有选项1或2这些出现,现在CPU使用率一直60%左右。。。。。
希望作者调整一下带宽占用选择自定义时的脚本逻辑。
在每个带宽占用周期,满速探测带宽时,短时间会对服务器的响应速度造成较大影响。希望改为:在选择自定义带宽占用的情况下,直接按照限速下载文件,无需使用speedtest进行测速,避免测速时影响网络流量。
谢谢!
Created symlink /etc/systemd/system/timers.target.wants/bandwidth_occupier.timer → /etc/systemd/system/bandwidth_occupier.timer.
Failed to start bandwidth_occupier.timer: Unit bandwidth_occupier.timer has a bad unit file setting.
See system logs and 'systemctl status bandwidth_occupier.timer' for details.
oalive.sh: line 198: restorecon: command not found
oalive.sh: line 199: restorecon: command not found
Failed to start bandwidth_occupier.timer: Unit bandwidth_occupier.timer has a bad unit file setting.
See system logs and 'systemctl status bandwidth_occupier.timer' for details.
带宽限制安装成功 脚本路径: /usr/local/bin/bandwidth_occupier.sh
The bandwidth limit script has been installed at /usr/local/bin/bandwidth_occupier.sh
建议将 Updating package management sources 去除或单列为脚本的一个选项。 不然每次启动脚本都要强制先 update 一下,非常占用时间。而且生产环境下,有很多 package 是不需要更新的,否则可能会出现诸多奇怪的问题。
amd没问题,挺好的
arm x86自适应容器镜像.jpg
发现今天AMD小鸡RAM动不动就被干到90%+,然后哪吒探针TG就显示故障了,SSH登不上,缓了半天才好,但是会重复,哪吒探针TG报警不断。。。ARM机2+12的相对抗折腾,干不到90%+以上
请问脚本安装完成后,如果不执行选项2和选项3,会一直在后台运行吗?
一直后台运行的话,就能满足甲骨文的3条规则,就不会被甲骨文停机了?
如果只需要满足其中一项,建议把流量的删除
建议增加停止和启动项,而不需要卸载才停止
发错了。。。。
安装完成了。这些script是怎么运行的?crontab里面没有东西。
原脚本是带宽占用每30分钟下载一次1G~10G大小的文件进行占用,占用20%的总网速。
想自定义间隔时间、文件大小、带宽网速。
或者应该把这次停机视为一种警告,以后保持资源占用就不会有问题了呢?
能不能在载入脚本后显示当前CPU,内存,带宽是否在执行,要是还能显示当时安装的参数就更好了,例如“CPU占用:20%”这样,因为有时候都忘记了有没有装保护脚本了哈哈哈哈哈
如果安装了来自speedtest官方源的cli程序,会导致无法安装Ubuntu等发行源的speedtest-cli程序
https://www.speedtest.net/apps/cli
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.