FileSystemWatcher and SERVER resources

  • Thread starter Thread starter Jerry Ham
  • Start date Start date
J

Jerry Ham

I've looked info on the FileSystemWatcher (and the
FindFirstChangeNotification / ReadDirectoryChanges API functions), and I
can't find the answer to this:

How scalable are these functions in terms of server resources? For instance,
if I have a Windows 2000 / Windows 2003 server with 2,000 clients holding a
ReadDirectoryChanges or FileSystemWatcher handle - what happens to the
server? Does this overload some heap somewhere? When a file in that folder
does change (I am thinking it might change twice a week), then what happens
to the server as it has approximately 2,000 RPC's to send out? Is there any
impact to the server from a workstation that has one of these handles and
then the workstation crashes without closing the handle (will the server
hold it open infinitely)?

I've got a couple of other options to explore - one is polling the folder
periodically, the other is putting a service on the server to explicitly
watch this folder and then having clients query the service UDP or TCP.
However, I'd like to know if anyone has any experience with the scalability
of ReadDirectoryChanges / FileSystemWatcher on the server.

Thanks!
Jerry
 
I haven't run anything quite to your scale yet, but I think for what you
want to do the FileSystemWatcher is the best bet. In normal operation the
FSW is pretty quiet, but it seems like polling, even with a service, might
keep your server pretty busy if the clients check in frequently or for some
reason request all at once. At least with the FSW you should only get an
occasional spike when file events occur.

On the other hand, Windows can be very generous in its file change
notifications, generating several events in the FSW for even small file
writes and generating more load for the network and server. Also, I can
only assume that when the client crashes the server leaves the handle open.
Yuck.

From what you've outlined so far you might want to consider a hybrid
approach- perhaps a service on the server that watches your folder(s) that
broadcasts the event over UDP(?) to clients with their own listening
service. In any case, I think I'll try some experiments over the weekend to
see just how the server machine behaves when lots of FSWs start watching...

HTH,
 
Back
Top