In a server running Nodejs, I am using multiple setInterval
functions, each having a relatively very long interval (24 hours, 36 hours, etc.).
setInterval(funcOne, 86400000)
...
setInterval(funcTwo, 172800000)
While they seem to work fine for now, I am a bit concerned about their reliability and performance. The server of coarse is running all the time. I am okay with restarting the functions if the server failed.
I tried to investigate about their interaction with the event loop, but it is still a bit vague for me.
- I want to make sure that these multiple functions are not blocking the event loop no matter how many they were.
- I am looking for possible failures or crashes due to them.
- I am keen to understand any performance overhead they might cause, if any.
PS: I am not willing to migrate those functionalities from the server to a cloud function or a serverless app at the moment.