Home All Groups Group Topic Archive Search About

FileWatcher Multiple Unrelated Directories

Author
2 Nov 2006 4:10 PM
Jon Turlington
I have a Windows Service that I use to watch for certain files of
certain sizes being created in directories. When the file size is of my
specified size a SQL connection is made to determine if any action
should be taken. The problem is that this puts an extremely high load
on the server at times. I believe it would be more efficient to know
which directories in the tree are supposed to have this action taken
rather than having to hit the SQL server so often.

My Questions:

1. Would it be more efficient to create a multitude of FileWatchers to
watch each directory individually?

2. Is it possible to specify many paths on a single watcher?

3. Any got any ideas to reducing the load signifigantly?

Thanks In Advance!

Jon Turlington

Author
2 Nov 2006 9:44 PM
Mattias Sjögren
Jon,

>1. Would it be more efficient to create a multitude of FileWatchers to
>watch each directory individually?

I don't think so but the best way to tell is to try it.


>2. Is it possible to specify many paths on a single watcher?

No, only a single common parent directory and include watching
subdrectories.


>3. Any got any ideas to reducing the load signifigantly?

Cache as much data as possible on the client to reduce the number of
hits to the SQL server.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

AddThis Social Bookmark Button