Solved

FileSystemWatcher - reliability and huuuuuge implementation

Posted on 2009-07-02
6
1,227 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
6 Comments
 
LVL 9

Expert Comment

by:Rahul Goel
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 500 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now