The default AppPool timeout is 20 minutes. Might you be running into this? If so, you can add something like this to a startup script to change the timeout:
%windir%system32inetsrvappcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00
Here's another answer I posted, to a different question, discussing this further.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…