Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

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


User avatar
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 Application 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?


9 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

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

  • User Avatar
    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?

  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

  • User Avatar
    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!

  • User Avatar
    0
    digitalcontrol created

    Is there any solution/recommendation for this problem?

  • User Avatar
    0
    maliming created
    Support Team

    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.

  • User Avatar
    0
    digitalcontrol created

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

  • User Avatar
    0
    ismcagdas created
    Support Team

    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 [email protected]) ?

    Thanks,

  • User Avatar
    0
    digitalcontrol created

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