cnk3x / xunlei

提取自群晖平台的迅雷下载套件,用在其他Linux机器上的迅雷远程下载服务
MIT License
1.45k stars 169 forks source link

运行一段时间后出现 内存使用超出限制 问题,导致网页无法打开,但是此时容器状态还是 UP #181

Closed simontigers closed 2 months ago

simontigers commented 2 months ago

重启后,过一两个小时还是会出现, 请问有遇到过么?或者哪里可以修改 idle_rss_limit=260 的限制?

运行信息如下 docker-compose.yml services: xunlei: image: cnk3x/xunlei container_name: xunlei_container privileged: true ports:

cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.4 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.4 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian

日志: 08/26 18:59:56 WRN [xunlei-pan-cli] [device_space=&rssMB=548&idle_rss_limit=260&out_memory_times=116] > memory usage limit rss > idle_rss_limit 08/26 18:59:56 INF [xunlei-pan-cli] [device_space=&rssMB=548&idle_rss_limit=260&memOut=116] > memory usage out of limit 08/26 19:00:26 WRN [xunlei-pan-cli] [out_memory_times=117&device_space=&rssMB=548&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 08/26 19:00:26 INF [xunlei-pan-cli] [rssMB=548&idle_rss_limit=260&memOut=117&device_space=] > memory usage out of limit 08/26 19:00:56 WRN [xunlei-pan-cli] [idle_rss_limit=260&device_space=&rssMB=548&out_memory_times=118] > memory usage limit rss > idle_rss_limit 08/26 19:00:56 INF [xunlei-pan-cli] [device_space=&rssMB=548&idle_rss_limit=260&memOut=118] > memory usage out of limit 08/26 19:01:26 WRN [xunlei-pan-cli] [rssMB=549&device_space=&idle_rss_limit=260&out_memory_times=119] > memory usage limit rss > idle_rss_limit 08/26 19:01:26 INF [xunlei-pan-cli] [rssMB=549&device_space=&idle_rss_limit=260&memOut=119] > memory usage out of limit 08/26 19:01:56 WRN [xunlei-pan-cli] [device_space=&rssMB=549&out_memory_times=120&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 08/26 19:01:56 INF [xunlei-pan-cli] [idle_rss_limit=260&memOut=120&device_space=&rssMB=549] > memory usage out of limit 08/26 19:01:56 WRN [xunlei-pan-cli] [idle_rss_limit=260&memOut=120&device_space=&rssMB=549] > memory usage out of limit panic 08/26 19:01:56 WRN [xunlei-pan-cli] panic: idle memory usage out of limit 08/26 19:01:56 WRN [xunlei-pan-cli] 08/26 19:01:56 WRN [xunlei-pan-cli] goroutine 105 [running]: 08/26 19:01:56 WRN [xunlei-pan-cli] gitlab.xunlei.cn/xlppc/pan-cli/pkg/download_runner.ProcessStat(0xc00045de00) 08/26 19:01:56 WRN [xunlei-pan-cli] /xunlei-pan-cli/pkg/download_runner/upload.go:153 +0xa2d 08/26 19:01:56 WRN [xunlei-pan-cli] created by gitlab.xunlei.cn/xlppc/pan-cli/pkg/commands.StartDeviceRunner 08/26 19:01:56 WRN [xunlei-pan-cli] /xunlei-pan-cli/pkg/commands/runner.go:80 +0xb6 08/26 19:01:57 WRN [xunlei-pan-cli] [report=true&panCliPid=35] > CheckProcess Signal err:os: process already finished 08/26 19:01:57 WRN [xunlei-pan-cli] > start new version 3.21.0=>3.21.0 err:os: process already finished

cnk3x commented 2 months ago

增加一个定时重启的功能会不会有所改善?

simontigers commented 2 months ago

嗯呢,我现在是用 cron 每半小时检查容器最新的日志中是否包含 err:os: process already finished, 来确认要不要 restart 容器

hwwrg commented 1 month ago

嗯呢,我现在是用 cron 每半小时检查容器最新的日志中是否包含 err:os: process already finished, 来确认要不要 restart 容器

哈喽,我无法通过grep查找到相关log,进而无法设置cron任务,请问您是怎么做的? 我是debian12

docker logs #containername --tail 50 | grep "kill process error:os: process already finished"

10/07 05:36:41 INF [xunlei-pan-cli] [userID=4936261&trace_id=ONJAAwdC&sync_seq=1&device_id=7abd3182d399f7bdda199550d8babede&device_space=&func_name=watchMqtt&start_time=10/07 03:39:29] > receive /user/me/asset stoped 10/07 05:36:41 INF [xunlei-pan-cli] [device_id=7abd3182d399f7bdda199550d8babede&device_space=&func_name=watchMqtt&start_time=10/07 03:39:29&userID=4936261&trace_id=ONJAAwdC&sync_seq=1] > receive /user/me/drive/tasks stoped 10/07 05:36:41 WRN [xunlei-pan-cli] [userID=4936261&func_name=MySync.Reverse&trace_id=mMmdf3eS&start_time=10/07 03:39:30&deviceID=7abd3182d399f7bdda199550d8babede] > srv.Serve err:http: Server closed 10/07 05:36:41 WRN [xunlei-pan-cli] [sync_seq=1&device_id=7abd3182d399f7bdda199550d8babede&device_space=&func_name=watchMqtt&start_time=10/07 03:39:29&userID=4936261&trace_id=ONJAAwdC] > receive reverse error http: Server closed 10/07 05:36:54 WRN [xunlei-pan-cli] [device_space=&rssMB=382&out_memory_times=105&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 10/07 05:36:54 INF [xunlei-pan-cli] [device_space=&rssMB=382&memOut=105&idle_rss_limit=260] > memory usage out of limit 10/07 05:36:57 WRN [xunlei-pan-cli] > directWakeup err wakupMessage agent is empty invalid character '<' looking for beginning of value 10/07 05:36:57 WRN [xunlei-pan-cli] 404 Not Found 10/07 05:36:57 WRN [xunlei-pan-cli] 10/07 05:36:57 WRN [xunlei-pan-cli]

404 Not Found

10/07 05:36:57 WRN [xunlei-pan-cli]
nginx
10/07 05:36:57 WRN [xunlei-pan-cli] 10/07 05:36:57 WRN [xunlei-pan-cli] 10/07 05:36:57 WRN [xunlei-pan-cli] 10/07 05:37:25 WRN [xunlei-pan-cli] 10/07 05:37:25 ERROR download_runner/upload.go:137 [device_space=&rssMB=382&idle_rss_limit=260&out_memory_times=106] > memory usage limit rss > idle_rss_limit 10/07 05:37:25 WRN [xunlei-pan-cli] 10/07 05:37:25 WARNING download_runner/upload.go:147 [rssMB=382&idle_rss_limit=260&memOut=106&device_space=] > memory usage out of limit 10/07 05:39:25 WRN [xunlei-pan-cli] [device_space=&rssMB=382&idle_rss_limit=260&out_memory_times=110] > memory usage limit rss > idle_rss_limit 10/07 05:39:25 INF [xunlei-pan-cli] [rssMB=382&idle_rss_limit=260&memOut=110&device_space=] > memory usage out of limit 10/07 05:39:55 WRN [xunlei-pan-cli] [device_space=&rssMB=385&idle_rss_limit=260&out_memory_times=111] > memory usage limit rss > idle_rss_limit 10/07 05:39:55 INF [xunlei-pan-cli] [idle_rss_limit=260&memOut=111&device_space=&rssMB=385] > memory usage out of limit 10/07 05:40:25 WRN [xunlei-pan-cli] [idle_rss_limit=260&out_memory_times=112&device_space=&rssMB=385] > memory usage limit rss > idle_rss_limit 10/07 05:40:25 INF [xunlei-pan-cli] [rssMB=385&idle_rss_limit=260&memOut=112&device_space=] > memory usage out of limit 10/07 05:40:55 WRN [xunlei-pan-cli] [device_space=&rssMB=386&idle_rss_limit=260&out_memory_times=113] > memory usage limit rss > idle_rss_limit 10/07 05:40:55 INF [xunlei-pan-cli] [memOut=113&device_space=&rssMB=386&idle_rss_limit=260] > memory usage out of limit 10/07 05:41:25 WRN [xunlei-pan-cli] [out_memory_times=114&idle_rss_limit=260&device_space=&rssMB=386] > memory usage limit rss > idle_rss_limit 10/07 05:41:25 INF [xunlei-pan-cli] [rssMB=386&memOut=114&idle_rss_limit=260&device_space=] > memory usage out of limit 10/07 05:41:55 WRN [xunlei-pan-cli] [out_memory_times=115&device_space=&rssMB=386&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 10/07 05:41:55 INF [xunlei-pan-cli] [memOut=115&device_space=&rssMB=386&idle_rss_limit=260] > memory usage out of limit 10/07 05:42:25 WRN [xunlei-pan-cli] [rssMB=386&idle_rss_limit=260&device_space=&out_memory_times=116] > memory usage limit rss > idle_rss_limit 10/07 05:42:25 INF [xunlei-pan-cli] [device_space=&rssMB=386&idle_rss_limit=260&memOut=116] > memory usage out of limit 10/07 05:42:55 WRN [xunlei-pan-cli] [device_space=&rssMB=386&idle_rss_limit=260&out_memory_times=117] > memory usage limit rss > idle_rss_limit 10/07 05:42:55 INF [xunlei-pan-cli] [memOut=117&device_space=&rssMB=386&idle_rss_limit=260] > memory usage out of limit 10/07 05:43:25 WRN [xunlei-pan-cli] [out_memory_times=118&device_space=&rssMB=386&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 10/07 05:43:25 INF [xunlei-pan-cli] [idle_rss_limit=260&memOut=118&device_space=&rssMB=386] > memory usage out of limit 10/07 05:43:55 WRN [xunlei-pan-cli] [device_space=&rssMB=386&idle_rss_limit=260&out_memory_times=119] > memory usage limit rss > idle_rss_limit 10/07 05:43:55 INF [xunlei-pan-cli] [idle_rss_limit=260&memOut=119&device_space=&rssMB=386] > memory usage out of limit 10/07 05:44:25 WRN [xunlei-pan-cli] [out_memory_times=120&device_space=&rssMB=386&idle_rss_limit=260] > memory usage limit rss > idle_rss_limit 10/07 05:44:25 INF [xunlei-pan-cli] [rssMB=386&idle_rss_limit=260&memOut=120&device_space=] > memory usage out of limit 10/07 05:44:25 WRN [xunlei-pan-cli] [rssMB=386&idle_rss_limit=260&memOut=120&device_space=] > memory usage out of limit panic 10/07 05:44:25 WRN [xunlei-pan-cli] panic: idle memory usage out of limit 10/07 05:44:25 WRN [xunlei-pan-cli] 10/07 05:44:25 WRN [xunlei-pan-cli] goroutine 94 [running]: 10/07 05:44:25 WRN [xunlei-pan-cli] gitlab.xunlei.cn/xlppc/pan-cli/pkg/download_runner.ProcessStat(0xc000028200) 10/07 05:44:25 WRN [xunlei-pan-cli] /xunlei-pan-cli/pkg/download_runner/upload.go:153 +0xa2d 10/07 05:44:25 WRN [xunlei-pan-cli] created by gitlab.xunlei.cn/xlppc/pan-cli/pkg/commands.StartDeviceRunner 10/07 05:44:25 WRN [xunlei-pan-cli] /xunlei-pan-cli/pkg/commands/runner.go:80 +0xb6 10/07 05:44:25 WRN [xunlei-pan-cli] [report=true&panCliPid=36] > CheckProcess Signal err:os: process already finished 10/07 05:44:25 WRN [xunlei-pan-cli] > start new version 3.21.0=>3.21.0 err:os: process already finished 10/07 05:44:35 WRN [xunlei-pan-cli] > killPid process.Signal SIGABRT err:os: process already finished 10/07 05:44:35 INF [xunlei-pan-cli] > kill process error:os: process already finished

simontigers commented 1 month ago

if docker logs -n 20 xunlei_container-new | grep -q "err:os: process already finished"; then echo "[$current_time] Error found in logs. Proceeding with docker-compose restart..." else echo -e "\n[$current_time] No error found in logs. Exiting script." fi

hwwrg commented 1 month ago

if docker logs -n 20 xunlei_container-new | grep -q "err:os: process already finished"; then echo "[$current_time] Error found in logs. Proceeding with docker-compose restart..." else echo -e "\n[$current_time] No error found in logs. Exiting script." fi

不行。显示没有找到log 运行docker logs -n 20 xunlei_container-new | grep -q "err:os: process already finished",则打印全部20行log

simontigers commented 1 month ago

更换适合你这这种情况的搜索关键词