Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7821165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:33:08+00:00 2026-06-02T07:33:08+00:00

I have a windows service that is currently instantiating about a dozen FileSystemWatcher instances

  • 0

I have a windows service that is currently instantiating about a dozen FileSystemWatcher instances to monitor shared folders across the corporate network for files to be processed.

I am looking into adding more instances so I’m wondering if anyone here has experience (with production systems) as to what are practical limits on number of FileSystemWatcher instances a production system can reliably handle?

Edit: In my case, the InternalBufferSize property is not modified so the InternalBufferSize is the default 8 KB… I assume the increase in InternalBufferSize would affect the number of FileSystemWatcher instances a system can run simultanesouly so that is also a part of the equasion…

Edit: If you think that this is exclusively a resource issue and it only depends on the amount of available memory or some other hardware aspect of the system, please share your experience or links to documentation or articles that corroborate your opinion… I would really like to hear from someone who reached the limit in production regardless of their hardware specs so please before voting to close consider that 7 other people in less than 20 minutes have shown interest in hearing from someone who pushed the limits on this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:33:09+00:00Added an answer on June 2, 2026 at 7:33 am

    FileSystemWatcher under the cover uses ReadDirectoryChangesW http://msdn.microsoft.com/en-us/library/windows/desktop/aa365465(v=vs.85).aspx. This is a reasonably inexpensive operation which is just a read from the directory that completes on a change.

    The results are stored in a kernel buffer before they are copied into your own memory buffer of FileSystemWatcher.

    That’s the two OS resources to take into consideration, the Handle created by the call to CreateFile by FileSystemWatcher, and the 8KB (default) buffer size in the Kernel for each FileSystemWatcher object which takes away from your system’s Kernel Paged and None-Paged Pools.

    Your FileSystemWatchers are essentially competing for these three resources.

    1. CPU time to process the changes
    2. Handles on the system
    3. Page Pool

    You’re unlikely to hit a problem with (2).
    Likely to hit a problem with (3) on a power system (loads of CPU) running x86.
    Otherwise (1) will be your limit.

    Handles

    Handles are exhaustible (specially on x86), more on this here, http://blogs.technet.com/b/markrussinovich/archive/2009/09/29/3283844.aspx

    But at 16million+ handles (even on x86) before you run out, for your intententions, I’d think of it as an infinite resource. You’ll exhaust the CPU processing changes well before you hit any OS limit.

    Page/Non-Paged Pools

    Page/Non-Paged Pools can be seen in task manager. On x86 they are very finite. More here, http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx#memory_limits

    CPU

    You’ll see loads of anecdotal evidence that when this is exhausted, FileSystemWatcher sort of stops working. Some directory changes get reported, some don’t, and inevitable on large implementations of FileSystemWatcher you end up having to detect these occassions and do a directory listing yourself, or do it on a polling bases.

    Notes

    If you’re implementing a load of FileSystemWatchers watch out for;

    1. Buffer over runs
    2. Buffer size greater than 64KB on network paths.

    More on good coding practice for this object here, http://bytes.com/topic/visual-basic-net/answers/536125-filesystemwatcher-across-network#post2092018

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a C# Windows service that currently processes all the PDFs by reading
I have a windows service (currently running under Windows 2003 Server) that needs to
We currently have a production application that runs as a windows service. Many times
I currently have a windows service that runs every 5 minutes. The code selects
We currently have an application (Windows service) that connects to another of our applications
I have a dotnet windows service that's currently hung, but running. Is there anyway
I have a Windows Phone 7 app that (currently) calls an OData service to
I have a Windows service that writes messages to the Event Log. I also
I have a windows service that does some intensive work every one minute (actually
I have a Windows service that runs as a logged-in user (local admin). During

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.