?
Solved

FileSystemWatcher - reliability and huuuuuge implementation

Posted on 2009-07-02
6
Medium Priority
?
1,293 Views
Last Modified: 2013-11-08
Hi,

I am looking to implement the FileSystemWatcher in some large corporations with 5000-100000 users across as many as a few hundred data servers. I appreciate there will be bottle necks when coming to evaluate my data - I will cross that bridge later. Does anyone have experience using the FileSystemWatcher on a large scale? Is it reliable? I have read something about catching errors to ensure all activity can be acknowledged.

All thoughts will be welcome.
0
Comment
Question by:CoolestBananas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Expert Comment

by:Rahul Goel ITIL
ID: 24761722
0
 

Author Comment

by:CoolestBananas
ID: 24761800
That is a very useful link. It is irritating that this class is unreliable - so predictable! Have you had any other feedback? Is this your test case?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 24763673
There are many more issues with the FileSystemWatcher. It not only misses some files, it would raise multiple events for the same file. As a test, watch a directory in a sample program and then use notepad to create a text file in that directory. You will receive two events for that same file. The best approach, in your case as it involves so many users and servers, would be to hook into Windows storage system at low level and monitor the hard disk activity. Here are some references but these mainly cover the UI aspect of hooking

http://msdn.microsoft.com/en-gb/magazine/cc188966.aspx

http://www.codeproject.com/KB/system/globalsystemhook.aspx?msg=840940

http://msdn.microsoft.com/en-us/library/ms644959%28VS.85%29.aspx

http://www.codeproject.com/KB/cs/netwin32hooks.aspx

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 15

Expert Comment

by:Solar_Flare
ID: 24767557
I have used the filesystemwatcher to monitor files at my company (probably around 250 clients each monitoring their own network share location for new files created). I found that the biggest issue was that network interruptions meant that I had to catch the error raised and loop at intervals trying to re-initialize the filesystemwatcher until the connection was restored (otherwise the program keeps running but just desen't receive any events)


0
 

Author Comment

by:CoolestBananas
ID: 24771168
CodeCruiser: I have had a quick skim through those links and they are very useful. Thanks. I feel comfortable hooking into the Win32 API. What worries me is that this is what the FileSystemWatcher is trying to do and obviously has problems and therefore is unreliable. Why is it unreliable? Will I not just come across the same problems but in a more roundabout way?

Solar_Flare: I would be running the "watcher" on the device and building a file to be dumped on another server for evaluation. What do you think?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24771213
FileSystemWatcher is developed so that it just raises all file creation, modification, deletion events etc. When you hook into API yourself, you could handle the situations so that you do could handle the creation of a file properly. You could also code around the Watcher in way that you monitor the events being raised and match them to previous recent events to detect if multiple events are generated for same file etc.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question