Developer forum

Forum » Ecommerce - Standard features » Constant logging out of admin portal

Constant logging out of admin portal

Jon Thorne
Jon Thorne
Reply
I would like to know what causes a logout of the user from the backend of the admin portal. It seems perhaps to be related to the import/export tasks (OData to/from BC). As since we have added a few more of these tasks running it is happening lots more. Now getting logged out every few minutes.
 
Is there any settings I can check to stop this happening?

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

You will get logged out if either your session is reset or if IIS will recycle the app pool.

There could be something in the integration job that clears cache - and one could be clearing all sessions. We should not have that as standard.

When you run the integration job you could have a high memory and/or CPU consumption - and depending on how your IIS is setup, IIS you be recycling because it tries to recover from high memory and cpu usages.

So first figure out if you have a recycle - you can see that in the Dynamicweb Monitoring if Dynamicweb is restarting - or in the server event viewer. 

If you have the recycle, you need to take a look at the settings for the app pool.

BR Nicolai

 
Jon Thorne
Jon Thorne
Reply

Hi Nicolai,

Thanks for the helpful comments. It does not seem the IIS app pool is recycling. I cannot find any evidence for this in the log and also when it does it can take quite a while, but when logged out I can just log stright back in quickly.

But saying that is certainly does seem to be load based. During the day under heavy load it was logging out every 5 mins (or less). But in the evening with much less load it has not logged out for 3 hours yet. With all the same integration tasks and orders still being placed (around 25 orders with live integration in the last 3 hours).

I have checked the app pool settings, there is no reset on cpu limit. I had already increased the idle timeout. There is no limits or regular time interval reset. All recycle events are logged.

So if it not an IIS recycle, and it is only an issue on high load, then it seems it is not a clear cache issue as this would happen under low load as well.

I'm still at a loss to know where to look, but regardless of the high load I really need it to stay logged in even if slow.

Regards,

Jon.

 
Jon Thorne
Jon Thorne
Reply

Hi Nicolai,

While I don't think there has been any IIS restart events, there are lots of DW "Application/Start" events like this:

There are many different URLs associated with these events. Are they related to the restart? Or just the url that was first called on restart?

Is there any way to tell what is causing these?

Jon.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

The URLs are not related to the restart - it just happens to be the first URL starting the website after it has closed.

These starts indicates that the app pool recycles - that should be the only reason. Question is why - my guess is memory consumption is higher than what is available. I think it is a setting on the app pool. It can also be code that will somehow load a lot of data into memory - i.e. a feed or list of products with 1000 or 10.000 of products? Or something similar.

BR Nicolai

 
Jon Thorne
Jon Thorne
Reply

Hi Nicolai,

I can't understand how these can be IIS app pool recycles as there is no log of this in the windows event viewer. And when I do an app pool recycle at a high usage time it can take a few minutes to restart. These logouts (Application/Start) events are quick and I can log straight back in. Also, this solution only has 126 products. Around 8000 users. No feeds.

Regards, Jon.

 

 
Jon Thorne
Jon Thorne
Reply

I have managed to find the solution for this issue myself after many months of trying to get help from others. If you do a lot of DW customisations you will probably run into this one. Seems there are not many people that know about the IIS config in enough detail to help with this. Please let me know if you are having a similar issue and I can help point you in the right direction.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Jon,

I am interested to find out about your solution.

Should we chat here or outside of the community?

Thank you,

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

We would like the information so it can be documented.

Thanks, Nicolai

 
Andrew Rushworth
Reply

Hi Jon,

Hope you are well.
Please can you elaborate on your findings and solution?

Thanks,
Andrew

 
Andrew Rushworth
Reply

Hey Jon,

I would like to know what you found in this regard please.

Thanks,
Andrew

 
Jon Thorne
Jon Thorne
Reply

The symptom that we had was constantly being logged out of the admin portal. We looked for any sort of error, but found none. The only thing that causes this issue is an IIS restart/recycle. There are several standard reasons for that which can easily be addressed. Some comments below that may help others resolve this issue.

1. Check for settings in the app pool that relate either to "regular time interval" or CPU/memory limits. Standard setup for this should not usually cause an issue

2. There is a setting related to "Disable Recycling for Configuration changes". Either disable this setting, or make sure that nothing is modifying your web.config file externally and you are not updating dll files in the bin directory.

Next is the main issue that we experienced:

3. If you have a few .aspx files in your web directory these will all be compiled by IIS on recycle. If too many files are compiled then it causes an automatic update and recycle of the process which gets into a loop of recycling IIS. The default number is 15 files, and considering there are already some in the DW source, only a few custom .aspx files can trigger this issue.

https://mskb.pkisolutions.com/kb/319947

ASP.NET has a feature in which the application is automatically restarted after a particular number of files are updated.
The restart should occur only one time for the whole list of updated files. After the application restart, old versions should not reside in memory. Therefore, the application should not have to be restarted to recompile new versions of files. However, this problem occurs when you load many new .aspx or .ascx files to the server (for example, 61 files). The server unloads the application when the first 15 files are recompiled and every time another 15 files are recompiled until the server reaches 61. This results in four application restarts even though only one is required.

 

Solution: Add this option to web.config file (default value: 15)

<compilation numRecompilesBeforeAppRestart="1000" >

 

Here are some other links to related information about this topic:

https://stackoverflow.com/questions/2413205/how-can-i-determine-why-my-asp-net-application-is-recycling

https://www.leansentry.com/guide/reset-restart-recycle-iis/max-application-pool-warmup

https://dnnsupport.dnnsoftware.com/hc/en-us/articles/4407122102162-How-to-disable-File-Change-Notifications-FCNMode-To-Improve-Performance

 

 

You must be logged in to post in the forum