2 years ago
Hi! I am running like 5-10 cron- jobs in one instance of node-cron being run. I notice that when multiple jobs overlap at the same time, Railway restarts the instance. I looked into resource usage, and nothing passes any set limits for the instance, but there is certainly a spike.
How can I see why Railway restarted my container? I haven't beeen able to answer this in the UI
13 Replies
98f66160-ce86-4b15-a73b-cab912256208/service/6221097a-1633-425a-b864-85d80f38795d
here in the middle of the job, without warning, it restarts. the job never completes as a result

there is memory spike around this time, but it never passes the limit, so i wouldnt expect this to be hte reason

and then, 2 minutes after this restart, another job starts. That could also cause this somehow?
How can i reach out to Railway to understand why the job was shut down?
2 years ago
im 99% sure that your app reached max memory limit and was killed because of that.
the graph might not show but we had problems like that in the past
2 years ago
but anyway, you're on pro plan, just send them an email
Good to know. This job is just a bit database write, so im a bit surpirsed we hit the memory limit! I will look into it and see if there's something up. Thanks!
2 years ago
well time to use nodejs streams in some way
2 years ago
stream the data instead of loading its entirety in memory
oh interesting. havent played around with that. i was just going to decrease the chunk for this write job haha, but that seems like a better solution
2 years ago
yeah your solution might be better if you just need to do that a few times a day and the data you're feeding doesnt scale