Thanks for the quick replies.
The frequency of the events is very low, yet a bit bursty. Typically 5-20 events at once, but only once a month or less.
Good to know that the query doesn't result in a poll. I am after a low latency on the delivery of the event (under 1 second is desired) with low overhead, such that on a loaded system there will not be resource issues that could cause the event processing
to fail.
I set up a test case: watch for when notepad.exe gets started with:
$query = "Select * from __InstanceCreationEvent within 15 where targetinstance isa 'Win32_Process' and targetInstance.Name = 'notepad.exe' "
I used a few of Ed Wilson's blogs to have a permanent event start a VB script that starts a PowerShell script that logs to a file when it starts. I created another PowerShell script that starts and stops ten instances of notepad.exe once every 50 seconds
and logs the start time to the same file.
Using "within 15" the average delay between starting notepad and starting the script is 8.3 seconds. When I shorted the within from 15 to 1, the average delay is shortened to 1.5 seconds. This is why I thought a poll was being used: there seems to
be a random distribution time of N+0.5 seconds, with a range of 1 to N.
Online blogs recommend that for a production system a WITHIN value of not less than 30 be used due to overhead. If the WITHIN value is actually only an aggregation time, not a poll interval, then using a small value (0.5) for infrequent events should
be okay.. correct?