Microsoft KB 911272 describes a condition we ran into where we managed to exhaust SMB file change notification system objects via ASP.NET. We implemented the hotfix, but does anyone know of a system performance counter that we could watch to avoid this situation in the future?
2 Answers
Turns out there's a performance counter for this: Redirector -> Current Commands.

- 51
- 3
-
Glad you resolved your issue. Please mark your answer as "accepted" when you are able. – jscott Jul 20 '12 at 23:52
What I recommend to people using file change notification objects is to run a single high performance thread that adds the change notifications to a high performance in memory queue and does NOTHING else, not even logging. Since pushing items on to a queue should be very fast, The queue that the file change notification has is only 8KB therefore is easy to overflow. Additional worker threads or processes then are responsible for popping items off the queue and lazily performing work in relation to these change events. With this design, I am able to respond to thousands of change notifications per second. If I need more performance, I just add more workers threads/processes to service the queue. Note: You will need to be proficient in multithreaded development including the use or creation of threadsafe objects.
If the internal buffer overflows, you can capture this event and respond to it.
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.error.aspx

- 1