我的Discord机器人有一段时间无法工作。在Heroku日志中,我发现在一次dyno重新定位后,我的机器人不断地从关闭切换到重新启动,从打开切换到关闭。当我的dyno再次被重新定位时,这个问题就停止了,虽然那天我又重新定位了几次,机器人还是可以成功重新启动。我该如何处理这个问题,我能防止这种情况发生吗?
2023-04-08T00:39:20.194824+00:00 heroku[worker.1]: Starting process with command `npm start`
2023-04-08T00:39:20.720188+00:00 heroku[worker.1]: State changed from starting to up
2023-04-08T00:39:23.488034+00:00 app[worker.1]:
2023-04-08T00:39:23.488052+00:00 app[worker.1]: > testing-bot@1.0.0 start
2023-04-08T00:39:23.488052+00:00 app[worker.1]: > node index.js
2023-04-08T00:39:23.488053+00:00 app[worker.1]:
2023-04-08T00:39:25.626333+00:00 app[worker.1]: Ready! Logged in as user#6684
2023-04-08T01:04:25.911497+00:00 heroku[worker.1]: Relocating dyno to a new server
2023-04-08T01:04:25.915742+00:00 heroku[worker.1]: State changed from up to down
2023-04-08T01:04:25.917624+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:04:49.556990+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2023-04-08T01:04:59.529137+00:00 heroku[worker.1]: Process exited with status 143
2023-04-08T01:11:26.865257+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:11:26.867504+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:13:57.723927+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:13:57.729075+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:18:58.575661+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:18:58.578503+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:25:30.458128+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:25:30.461314+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:31:00.224672+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:31:00.229650+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:36:15.400305+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:36:15.404544+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:42:17.073988+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:42:17.077104+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:46:33.577191+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:46:33.579738+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:53:04.643819+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:53:04.646758+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T01:56:36.236763+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T01:56:36.239451+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:03:07.438558+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:03:07.441858+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:09:39.894195+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:09:39.896798+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:16:11.558150+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:16:11.561671+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:33:59.334484+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:33:59.337397+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:38:00.483471+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:38:00.485077+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:43:35.000000+00:00 app[api]: Build started by user xxxxx@gmail.com
2023-04-08T02:43:45.603384+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:43:45.607493+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:44:05.657278+00:00 app[api]: Deploy f085a386 by user xxxxx@gmail.com
2023-04-08T02:44:05.657278+00:00 app[api]: Release v92 created by user xxxxx@gmail.com
2023-04-08T02:44:06.032766+00:00 heroku[worker.1]: Restarting
2023-04-08T02:44:09.000000+00:00 app[api]: Build succeeded
2023-04-08T02:48:10.000000+00:00 app[api]: Build started by user xxxxx@gmail.com
2023-04-08T02:48:45.612585+00:00 app[api]: Deploy 88da9af7 by user xxxxx@gmail.com
2023-04-08T02:48:45.612585+00:00 app[api]: Release v93 created by user xxxxx@gmail.com
2023-04-08T02:48:45.887026+00:00 heroku[worker.1]: Restarting
2023-04-08T02:48:50.000000+00:00 app[api]: Build succeeded
2023-04-08T02:55:17.858114+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:55:17.860506+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T02:57:33.482229+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T02:57:33.485139+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:01:03.551038+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:01:03.553534+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:07:23.309498+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:07:23.311979+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:13:53.266567+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:13:53.269400+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:18:52.236456+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:18:52.238519+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:25:23.546873+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:25:23.550562+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:28:24.070008+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:28:24.074333+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:34:55.779645+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:34:55.781821+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:40:27.449073+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:40:27.451674+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:46:58.833299+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:46:58.834845+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:53:13.785321+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:53:13.790739+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T03:59:15.148336+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T03:59:15.150727+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:03:32.560565+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:03:32.563044+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:06:17.129993+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:06:17.132919+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:06:40.000000+00:00 app[api]: Build started by user xxxxx.com
2023-04-08T04:07:17.039633+00:00 app[api]: Deploy 88da9af7 by user xxxxx@gmail.com
2023-04-08T04:07:17.039633+00:00 app[api]: Release v94 created by user xxxxx@gmail.com
2023-04-08T04:07:17.304728+00:00 heroku[worker.1]: Restarting
2023-04-08T04:07:20.000000+00:00 app[api]: Build succeeded
2023-04-08T04:12:48.334033+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:12:48.338607+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:19:08.202862+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:19:08.206655+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:25:35.330505+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:25:35.333541+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:32:06.821998+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:32:06.823835+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:34:21.717834+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:34:21.723595+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:41:10.167573+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:41:10.169431+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:47:40.131086+00:00 heroku[worker.1]: State changed from starting to down
2023-04-08T04:47:40.133580+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T04:48:43.206855+00:00 heroku[worker.1]: Starting process with command `npm start`
2023-04-08T04:48:43.756477+00:00 heroku[worker.1]: State changed from starting to up
2023-04-08T04:48:45.059659+00:00 app[worker.1]:
2023-04-08T04:48:45.059674+00:00 app[worker.1]: > testing-bot@1.0.0 start
2023-04-08T04:48:45.059674+00:00 app[worker.1]: > node index.js
2023-04-08T04:48:45.059675+00:00 app[worker.1]:
2023-04-08T04:48:46.808520+00:00 app[worker.1]: Ready! Logged in as user#6684
2023-04-08T06:29:33.841174+00:00 heroku[worker.1]: Relocating dyno to a new server
2023-04-08T06:29:33.849597+00:00 heroku[worker.1]: State changed from up to down
2023-04-08T06:29:33.852851+00:00 heroku[worker.1]: State changed from down to starting
2023-04-08T06:29:37.982119+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2023-04-08T06:29:57.450063+00:00 heroku[worker.1]: Process exited with status 143
2023-04-08T06:30:21.606144+00:00 heroku[worker.1]: Starting process with command `npm start`
2023-04-08T06:30:22.186549+00:00 heroku[worker.1]: State changed from starting to up
2023-04-08T06:30:24.877481+00:00 app[worker.1]:
2023-04-08T06:30:24.877493+00:00 app[worker.1]: > testing-bot@1.0.0 start
2023-04-08T06:30:24.877494+00:00 app[worker.1]: > node index.js
2023-04-08T06:30:24.877494+00:00 app[worker.1]:
2023-04-08T06:30:26.393836+00:00 app[worker.1]: Ready! Logged in as user#6684
1条答案
按热度按时间h7appiyu1#
我最近遇到了同样的问题,所以我正在运行的任务使用了大量的内存,我在一个性能L专用服务器上,我联系了支持,这是他们说的。
由于受影响的dynos位于专用服务器上(Performance-L dynos),我们已经看到了一些情况,其中CPU密集型任务有时可能会导致服务器上的健康检查服务确定某些不健康的内容。此外,对临时磁盘空间的积极使用可以触发平台触发dyno的重定位。可用磁盘空间是平台检查后端服务器的健康状况的度量之一。对于像Standard-2x这样的dyno类型,由于它们是共享的,因此它们比像Performace-L dynos这样的专用示例dyno提供了更多的磁盘空间。
我请求您检查是否正在积极使用磁盘空间,或者是否有任何CPU密集型任务导致在性能L上的worker dynos中看到这种情况,并查看是否可以解决。
如果在处理作业期间重新定位了工作机dynos,则作业可能会中断并需要重试。如果切换到共享示例(如Standard-2x dynos)不会导致此问题,则如果您满足应用程序的需求,则最好移动到这些示例。
我所做的解决我的问题只是降级到一个标准的2x服务器,这是它的错误问题消失了。如果你这样做,仍然有相同的问题,你正在运行一个密集的脚本任务,尝试将它们分成不同的批次或联系heroku支持