0

I have an application that is deployed in a farm that contains 2 front end server that are controlled by a Network Load Balaner In the application there is a Report part, the reports works as shown below.

  1. The application generates the report as a PDF file and save it in a certain folder in the application.
  2. I have a PDF viewer in the application that takes the URL of the file and displays it.

As you know, in the farm I can not ensure that the request in step 2 will go to the same server in step 1, and this will cause a problem for me.

Any help is very appreciated.

The problem is that after creating the file on a certain VM, I give the PDF viewer the url of the pdf viewer as "http://..../file.pdf". This will generate a new request that I cannot control, and I cannot know which server will server.

Ghyath Serhal
  • 7,466
  • 6
  • 44
  • 60

2 Answers2

2

The easiest (but possibly dirtiest) solution might be to set node affinity on the load balancer

This will essentially load balance initial requests from users, but then send future requests back to the initial server. It should get round your problem I think.

Its not the nicest way to solve these sorts of problems though. Read here for more.

Jon Egerton
  • 40,401
  • 11
  • 97
  • 129
0

Why don't you serve the pdf directly instead of writing to disk? That would solve your problem :)

Onkelborg
  • 3,927
  • 1
  • 19
  • 22
  • This is not feasible, because it is not supported in the PDF viewer. – Ghyath Serhal Sep 12 '12 at 09:12
  • How does that pdf viewer work? Does it open multiple connections or something? If not, how could the viewer know the difference between a file stored at disk and a file stored in memory? There's no magic, it's the same bytes – Onkelborg Sep 12 '12 at 11:53