Problem created by load balancing in ASP.NET

0 I have an ASP.NET 3.0 application that runs fine on a single server. It uses application variables to check if the user checked the file and blocks it for all other users. When I put the application on load-balanced servers, the application did not work as expected, since several users were sent to several servers, and each user could check the required file.

The main thing is that I can share the application variables in my application, although it is distributed across several servers. Or is there a better way to get a global variable?

EDIT: I am checking if Application ["FileLocked"] is checked true or false

+2
source share
4 answers

Two things for you:

  • In a load-balanced environment, instance data on one server will not be available to another. Although you can use the Out-of-process session state, you cannot easily make cache items or static class data available on servers. The user's request will not always be redirected to the same server (if you are not using something like sticky sessions), which may cause other problems.

  • , (, ), , . - , .

+2

, ? , . , , / (bool/). , , . , , .

+2

ASP.NET, , .

JonH, . , , . :

  • .
  • , . , ASP.NET (?) 20 . , , , - , , . .
+2

I think this is a task for the database. If you do not already have one, create a MySQL instance or another instance of RDBMS and use it to exchange similar information. If you use application memory to store this information, it will be lost whenever the application pool needs to be recycled or the web server is rebooted.

0
source

All Articles