Search code examples
asp.netwcfiisshared-hostingautostart

How do I autostart an IIS service on shared hosting (no access to ApplicationHost.config file)?


Is it possible to have an IIS service autostart with no access to the ApplicationHost.config file?

I have shared hosting on GoDaddy, with a few IIS services running. One of these services contains a method that starts a timer and updates some data on my server every 15 minutes. This is necessary for my Windows Phone app to function correctly.

However, GoDaddy seems to restart their servers once or twice every weekday at random times, which stops the service (and the necessary timer) from running until I call the method from a client application. I have to check pretty frequently to see if things are running and then start the service manually.

I'd like the service to start automatically whenever GoDaddy restarts the server, but since it's shared hosting I don't have access to ApplicationHost.config, and there doesn't seem to be an option for it in GoDaddy's IIS settings.

Anyone have any ideas?

Thanks!


Solution

  • IIS will recycle/terminate an idle Web app/w3p.exe every 20 minutes by default, for many good reasons. IIS also have a lot settings to restart Web apps that consume to much resource or generate too many errors. GoDaddy would restart servers regularly to clean up environment, since the servers might host a lot web applications with poor quality.

    Basically you can do

    1. You have a 24x7 machine, and you write a program or use cUrl to send client requests to your Web app every 1, 5, or 10 minutes to wake up.

    2. If you don't have a 24x7 machine, you may try some function in Amazon AWS to do wake up/warm up calls. I don't remember the respective service name in Amazon.

    3. Or you contact Godaddy's technical support about this issue.