title: .NET and Load Balancer?
body: <p>We are currently running a web application and have been experiencing regular issues with performance.  Specifically, users are getting "hanging" records quite often, throughout the day and with little warning.  We have been unable to pinpoint the issue yet, but after some research we think it may be related to our load balance configuration and the .net framework.  We are wondering if we are losing sessions in the application which causes issues with caching.  Vendor claims it is our configuration with the load balancer, but we have tried many things and have unable to bring resolution to the situation.</p>
  
  <p>The only resolution we have so far is to have the user close out of the browser and reopen the browser and start fresh.  Needless to say, they are annoyed with us.</p>
  
  <p>System Specifications (to my knowledge):</p>
  
  <ol>
  <li><p>4 Node Web Server Cluster which houses the application.  Load balancer using round robin format.</p></li>
  <li><p>Application is using .Net Framework v4.0.30319.</p></li>
  <li><p>SQL Server running separately on a different server.</p></li>
  </ol>
  
  <p>I checked the error logs and we are FREQUENTLY receiving these types of errors:</p>
  
  <ol>
  <li><p>ASP.NET session has expired or could not be found</p></li>
  <li><p>Could not cache key....</p></li>
  <li><p>A cache factory was not able to be created. Please verify that Microsoft AppFabric is set up correctly on this client.</p></li>
  </ol>
  
  <p>CONTINUED</p>
  
  <p>Thanks for your quick responses. We are just the client and did not write this software, so please bear with me as I am still collecting as much information as I can. To give a little more color on the situation:</p>
  
  <ol>
  <li><p>The session state is InProc under MVC and the main website runs with this sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider</p></li>
  <li><p>The only reason I mentioned the load balancer was because I was seeing a lot of information on forums regarding session state and "stickiness". That is to say, maintaining sessions when using the .net framework and load balances. We currently have out load balancers set to issue a cookie based on the user and have the "sticky" settings turned on. </p></li>
  <li><p>We have sent the error logs to the vendor, but haven't received much of a response, which is why I turned to the forums for answers.
  We have been trying to identify the source of the broken cache, but have been unable to do so.</p></li>
  </ol>
  
  <p>4.Performance for users is very spotty. Overall it is slower for this version of the application compared to the prior version. Most concerning is that users will occasionally become "hung up" when performing basic tasks (conducting searches, opening large records).
  I forgot to mention that when the system is generating some of these error messages, it is not identifying the user who was logged in when the error occurred. Here is a sample of the log:</p>
  
  <blockquote>
    <p>Exception Message</p>
    
    <p>ASP.NET session has expired or could not be found</p>
    
    <p>Logged In As</p>
    
    <p>Stack Trace at
    Microsoft.Reporting.WebForms.ViewerDataOperation..ctor() at
    Microsoft.Reporting.WebForms.HttpHandler.GetHandler(String
    operationType) at
    Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
    context) at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    Boolean&amp; completedSynchronously)</p>
  </blockquote>
  
  <hr>
  
  <p>We are just the client and did not write this software, so please bear with me as I am still collecting as much information as I can. To give a little more color on the situation:</p>
  
  <ol>
  <li>The session state is InProc under MVC and the main website runs with this sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider </li>
  <li>The only reason I mentioned the load balancer was because I was seeing a lot of information on forums regarding session state and "stickiness".  That is to say, maintaining sessions when using the .net framework and load balances.  We currently have out load balances set to issue a cookie based on the user and have the "sticky" settings turned on.</li>
  <li>We have sent the error logs to the vendor, but haven't received much of a response, which is why I turned to the forums for answers.  </li>
  <li>We have been trying to identify the source of the broken cache, but have been unable to do so.</li>
  <li>Performance for users is very spotty.  Overall it is slower for this version of the application compared to the prior version.  Most concerning is that users will occasionally become "hung up" when performing basic tasks (conducting searches, opening large records).</li>
  <li>I forgot to mention that when the system is generating some of these error messages, it is not identifying the user who was logged in when the error occurred.  Here is a sample of the log:</li>
  </ol>
  
  <blockquote>
    <p>Exception Message</p>
    
    <p>ASP.NET session has expired or could not be found</p>
    
    <p>Logged In As </p>
    
    <p>Stack Trace at 
    Microsoft.Reporting.WebForms.ViewerDataOperation..ctor() at
    Microsoft.Reporting.WebForms.HttpHandler.GetHandler(String
    operationType) at
    Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
    context) at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    Boolean&amp; completedSynchronously)</p>
  </blockquote>