Load balancing in an ASP.NET MVC web application. What can not be done?

I am developing a web application, and I was asked if it will work with a load balancer. My initial reaction is yes, as there is no state being tracked between requests anywhere in the system. However, there is a certain state of the application loaded when the application starts (configuration settings from the database basically.)

  • This data is read-only. Is it enough to rely on the usual cache dependency mechanisms to manage this and invalidate these objects in all cluster applications, or will I need to switch to a common caching system like App Fabric to ensure reliability / consistency?

  • With diagnostics enabled, I have numerous logging calls using EventSource.Write and exiting the process logger. I assume that in this case I will need one registrar installed on each of the servers in the cluster to pick up events, each of which is triggered. I haven’t been too fussed about this, but what is a good way to determine which server in the cluster was serving the request?

+4
source share
1 answer
  • If you initialize the data on each server separately and read-only, there is no problem. Individual applications will have a copy.

  • Yes, you need a logger for each instance. To identify the server, you can include the IP address of the servers in the log. This way you can track the server. (if you have static IPs, but I assume you are doing this).

+2
source

All Articles