Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a problem with Load balancing severs with my .net MVC application.

In My application we generates XML/TXT file and Save it in Server and user will download the XML/TXT file from server.

The problem is when the user generates XML/TXT file and save it in server, user is balanced in Server1 and when the user downloads the XML/TXT file and he/she resides in server2. So, user couldnt able to get the recently generated file from server1.

Please give me some solution for this scenario.

Thanks,
Mani
Posted
Comments
ZurdoDev 14-Jan-16 7:44am    
How are they trying to download? Is it a url they click? Do you send the bytes through the Response object? How are you doing it?

Create a network share that all servers have access to and save files there.
Member 7741262 14-Jan-16 8:01am    
Yes Ryan. They click an ULR to download. but they are using server.mapPath to get the entire URL of the server. Can you please share me some example for network share?
ZurdoDev 14-Jan-16 8:10am    
Network share? You know what one is, I would imagine. The problem is you need a path that both/all servers can get to. So, create a share somewhere, could be anywhere, then a mapped drive on each of the servers so that the path can be accessible by any of the server. For example. S:\Files\

1 solution

What type of affinity are you using in your NLB?

If your server affinity is important for your processes to work I'd suggest using the Network affinity option.

We have users behind load balanced proxy servers. This means subsequent requests can come from different public IP addresses. Normaly these IP addresses will only vary on the 4th octet e.g.

1.1.1.x

Users on mobile data connections can also suffer with rapidly changing public IP addresses.

That's what network affinity manages. Any requests where the requesting IP address matches on the 1st 3 octets will always be routed to the same server.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900