Open Closed

Application idle time out after some time, IIS hosting #7318


0
digitalcontrol created

Our application mostly works fine, but sometimes (after it is inactive for some time like an hour or two) it could take ages for login only. At first we suspect on some IIS configuration settings like Applicaimage.pngtion pool settings from screenshot below but changing these values did not help. Does this behavior sounds familiar to you and do you have any additional IIS configuration recommendation for hosting application based on ASP.NET Zero framework?

image.pngimage.png


9 Answer(s)
  • 0
    ismcagdas created

    Hi,

    Could you change start mode of your app pool like below:

    image.png

  • 0
    digitalcontrol created

    We were testing this but did not help. We also notice that after site restart first load takes few minutes. Do you know why that happens?

  • 0
    ismcagdas created

    Hi @digitalcontrol

    The restart process might take quite long time than a page refresh but few minutes is too much. Could you check your log files to see which part is taking long time during the restart ? Log files must be under App_Data/Logs folder. You can restart your app pool and check the logs after that. By the way, if your server restarts, "Always Running" option can't help.

    When you set Start Mode to "Always Running", the app pool shouldn't be stop at all. I think there is something else going on in your situation.

  • 0
    digitalcontrol created

    We found out that delay cause call constructor class {ProjectName}AppServiceBase as many times as many services we have on the first app load. Since we have around 100 services that cause delay of at least a minute. Also, this happens if we make a request via Postman. We made a test with clean ASP NET Zero framework and situation is same except it is faster because there are fewer services, what is interesting in that case if we make a particular request via Postman {ProjectName}AppServiceBase class is instanced once only. This is becoming business-critical so help be very appreciated. Thanks in advance!

  • 0
    digitalcontrol created

    Is there any solution/recommendation for this problem?

  • 0
    maliming created

    We found out that delay cause call constructor class {ProjectName}AppServiceBase as many times as many services we have on the first app load

    I didn't understand it. You mean that the application will call the AppServiceBase constructor N times each time it starts.

  • 0
    digitalcontrol created

    Yes it will call it as many times as many Services(controllers) we have in the application.

  • 0
    ismcagdas created

    Hi **digitalcontrol **

    This is not normal. The AppService classes must be instantiated when they are used, not at the app startup. Is it possible to share your project with us via email (to info@aspnetzero.com) ?

    Thanks,

  • 0
    digitalcontrol created

    It looks like it was a bug in our code. Sorry cause disturbing.