I have an asp.net web application with several pages. In the load event for each page I check for a specific session ID in all of the pages and if it is null the redirect to the login page.
The problem started when I increased the worker process from 1 to 2 or 3 hoping to increase performance. I get this random behavior. I run 3 or 4 different browsers and login to the web application using different IDs and every now and then I get redirected
to the login page because the session is null. This happens only when I increased worker processes to above 1. Any ideas why it is doing that?
The problem with leaving worker process to 1 is that it takes a while if I run multiple browsers at once for testing purposes. I noticed that one has to finish before the next one will finish. I thought that is because I have one worker process.
Any ideas thoughts or suggestions is greatly appreciated.
have an asp.net web application with several pages. In the load event for each page I check for a specific session ID in all of the pages and if it is null the redirect to the login page.
This is a bad design. Session lives in server memory and should not be used to persist user credentials as it limits expandability - adding servers to manage load.
aazizasp
The problem started when I increased the worker process from 1 to 2 or 3 hoping to increase performance. I get this random behavior. I run 3 or 4 different browsers and login to the web application using different IDs and every now and then I get redirected
to the login page because the session is null. This happens only when I increased worker processes to above 1. Any ideas why it is doing that?
You created what's called a web garden. Basically, isolation between worker processes. If you are using In-Proc Session then Worker process 1 cannot see Worker process 2's memory. Again, don't store user credentials in Session. Session has other performance
issues as well.
aazizasp
The problem with leaving worker process to 1 is that it takes a while if I run multiple browsers at once for testing purposes. I noticed that one has to finish before the next one will finish. I thought that is because I have one worker process.
Yeah, that's does not sound right. However, if you opened the same browser with the same Session cookie then yes that is the expected behavior. The server must queue the requests due to Session. This stops request 2 from changing Session while request
1 is running.
aazizasp
Any ideas thoughts or suggestions is greatly appreciated.
Read the docs before arbitrary making configuration changes. Use best practices for persisting user authentication like the built in membership API(s) provided by ASP.
Hi mgebhard,
Thanks for responding. I am using the session to store an id that i use to run queries with throught the application. It is not used for credentials. In fact my application is behind an access manager system that utilizes saml authentication. Basically once
they authticate, i use for fill to populate the session variable and use it throughout the application. I hope this makes sense to you.
Hi mgebhard,
Thanks for responding. I am using the session to store an id that i use to run queries with throught the application. It is not used for credentials. In fact my application is behind an access manager system that utilizes saml authentication. Basically once
they authticate, i use for fill to populate the session variable and use it throughout the application. I hope this makes sense to you.
You are explaining the purpose for using Session which is irrelevant. The fact that you are using session is what's causing the problems you are experiencing. I would change the design and find a solution other than Session especially if you are using
SAML.
Member
22 Points
121 Posts
Multiple worker processes question
Feb 19, 2018 09:33 PM|aazizasp|LINK
Hello friends,
I have an asp.net web application with several pages. In the load event for each page I check for a specific session ID in all of the pages and if it is null the redirect to the login page.
The problem started when I increased the worker process from 1 to 2 or 3 hoping to increase performance. I get this random behavior. I run 3 or 4 different browsers and login to the web application using different IDs and every now and then I get redirected to the login page because the session is null. This happens only when I increased worker processes to above 1. Any ideas why it is doing that?
The problem with leaving worker process to 1 is that it takes a while if I run multiple browsers at once for testing purposes. I noticed that one has to finish before the next one will finish. I thought that is because I have one worker process.
Any ideas thoughts or suggestions is greatly appreciated.
Thank you.
All-Star
53081 Points
23654 Posts
Re: Multiple worker processes question
Feb 19, 2018 10:01 PM|mgebhard|LINK
This is a bad design. Session lives in server memory and should not be used to persist user credentials as it limits expandability - adding servers to manage load.
You created what's called a web garden. Basically, isolation between worker processes. If you are using In-Proc Session then Worker process 1 cannot see Worker process 2's memory. Again, don't store user credentials in Session. Session has other performance issues as well.
Yeah, that's does not sound right. However, if you opened the same browser with the same Session cookie then yes that is the expected behavior. The server must queue the requests due to Session. This stops request 2 from changing Session while request 1 is running.
Read the docs before arbitrary making configuration changes. Use best practices for persisting user authentication like the built in membership API(s) provided by ASP.
Member
22 Points
121 Posts
Re: Multiple worker processes question
Feb 20, 2018 12:58 AM|aazizasp|LINK
Thanks for responding. I am using the session to store an id that i use to run queries with throught the application. It is not used for credentials. In fact my application is behind an access manager system that utilizes saml authentication. Basically once they authticate, i use for fill to populate the session variable and use it throughout the application. I hope this makes sense to you.
All-Star
53081 Points
23654 Posts
Re: Multiple worker processes question
Feb 20, 2018 11:28 AM|mgebhard|LINK
You are explaining the purpose for using Session which is irrelevant. The fact that you are using session is what's causing the problems you are experiencing. I would change the design and find a solution other than Session especially if you are using SAML.