Solved

FileSystemWatcher - reliability and huuuuuge implementation

Posted on 2009-07-02
6
1,251 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 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 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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