Solved

FileSystemWatcher - reliability and huuuuuge implementation

Posted on 2009-07-02
6
1,231 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

861 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

22 Experts available now in Live!

Get 1:1 Help Now