Kentico Application restarting every hour

Lokesh Chevuru asked on September 5, 2024 14:58

Hi Team,

I noticed that the application is restarting every hour, as I saw in the system overview. Could you please advise how to change it to restart every 30 minutes instead of every hour. I tried searching information on Google and also checked in the IIS but didn’t find any relevant inputs or settings. I noticed that the CPU and memory usage never exceeds 30-40%. We always have more than 10GB of free space on the disk. The Kentico application is restarting every hour. Before each restart, we are encountering numerous object reference errors and issues related to collection modification.

Recent Answers


John Lougee answered on September 5, 2024 19:36

Hi Lokesh,

It sounds like this is probably restarting due to the errors you are seeing rather than some setting to restart it that frequently. There is a setting in IIS for the application pool where you can define intervals for recycling it (under the app pool -> Edit Application pool -> Recycling) but this is set to 29 hours by default (1740 mins) and I don't think this would necessarily restart the application but just start a new worker process and transfer the requests over to that.

Can you give some more info on the error details? Maybe we can pinpoint and suggest a fix for those errors instead.

0 votesVote for this answer Mark as a Correct answer

Lokesh Chevuru answered on September 5, 2024 20:45

Thanks John for the reply. We have four servers, and each server restarts every hour, even though they are not experiencing any issues. Just before restarting, we could see a lot of issues such as "Object reference not set to an instance of an object" (related to static variables and interface service variables) and "Collection was modified; enumeration operation may not execute" (which is related to static variables). These issues are not observed once the application is restarted.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on September 6, 2024 06:47

I would recommend bringing this up to your developers and debug the code - there could be some infinite loop which causes the app to crash periodically. The stack trace should tell your devs where it is coming from and they can debug the issue. Check the Windows Event viewer too to see if there are any more details or other errors. From this vague and general information we cannot help further - we do not know the project, its code. This is something you need to investigate on your side.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.