Load balancing window services

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
We have a requirement where windows service application XX will be deployed
on two servers that is load balanced. The windows service polls the file
directory and performs some logic when the file is being copied to the UNC
path. The window service uses FileSystemWatcher to perform file operations.
How does it work when the window service on two servers is pointing to same
file location.

Are there any articles or can somebody please point me in the right direction.

Thanks
Anand
 
Anand,

Are you talking about Active/Active or Active/Passive balancing? Are you
using Windows clustering?

You don't want it to run on two servers at the same time, on the same
directory. I would have it only run on one instance at a time (like
Active/Passive mode).

BTW, make sure the files are finished being written before performing any
operation. The easiest way to do this is to attempt to open the file using
write access:

Try
Using fs As New IO.FileStream("<file name>", IO.FileMode.Open,
IO.FileAccess.Write)
fs.Close()
End Using
Catch ex As Exception
' do something
End Try

Hope this helps,


Steve
 
Thanks for your reply. For scability purpose we need to run window service on
a multiple servers which is windows clustered. We will receive thousands of
files from our partner, which we cannot process on a single box. It looks
like there is no solution out there with window services clustered on a
multiple servers.

We will go with the windows scheduler instead of window service.

Thanks,
Anand
 
Back
Top