467,101 Members | 1,144 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,101 developers. It's quick & easy.

Problems with search results, hosting over a web farm

Hi I have developed an application that people can use to search for planning applications. The way it works is that once search criteria has been selected and submit is hit, the server will save the search results in an xml file and then redirect to the view search results screen. This screen checks if the xml file exists and if it does, it displays the results, otherwise it says results have expired.

The problem is the fact that this is hosted on two servers acting as a load balancer. When the xml file is created it is saved in /ApplicationSearch/Generic/XMLtemp (virtual directory). This means that whatever server hosts the request (192.168.120.30 and 192.168.120.51) will save the xml file in its own file directory. Then if the view results page gets opened from the wrong server, it will look for a file which exists on the other server and therefore display "Search results have expired."

Overall this means if you keep hitting refresh it will eventually look at the correct server and display the results but obviously this shouldn't have to happen, help please!
Dec 16 '08 #1
  • viewed: 1276
Share:
5 Replies
Frinavale
Expert Mod 8TB
Would it be possible for you to store the XML files in a common place on one computer? You're just going to have to be careful that the files names are unique for the user regardless of which server they're connected to.
Dec 16 '08 #2
balabaster
Expert 512MB
I wrote a whole long winded answer to this, but came to the conclusion that there's no simple way of preventing this occurrence completely. The best way is to tell your load balancer to maintain a sticky connection. That is - a single user on a single session will always send/receive requests to the same server. I'm not sure what load balancer you're using and hence if that's possible but there are load balancers out there that do this.
Dec 16 '08 #3
Cheers for the responses. I've got around this by creating a shared folder on one of the servers, then mapping to it from the other folder and calling it an x: drive. Then I've created this x: drive as a virtual directory on one server and the shared drive as a virtual directory on the other server. Seems to work just fine!

Plus Frinavale, I've maintained unique file names by creating a folder for each file named by the unique session ID
Dec 17 '08 #4
Frinavale
Expert Mod 8TB
Awesome :)
I'm glad you solved your problem :)
Dec 17 '08 #5
balabaster
Expert 512MB
And it will likely continue to work just fine until that server goes down... then what?
Dec 17 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

83 posts views Thread by D. Dante Lorenso | last post: by
2 posts views Thread by Jack Fox | last post: by
2 posts views Thread by webhead74 | last post: by
3 posts views Thread by =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post: by
13 posts views Thread by Massimo Fabbri | last post: by
reply views Thread by Rob Meade | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.