fatoldsun00 / node-red-contrib-watchdirectory

Watch directory for create, update, delete event
9 stars 6 forks source link

Can you implement a delay "every x seconds/minutes/hours/etc between every check? #9

Closed CreativeWarlock closed 2 years ago

CreativeWarlock commented 2 years ago

Hi,

your plugin is a great tool in our Node Red environment, checking for changes of CSV files in a very broad and deep folder structure.

The problem though is: Your node obviously checks for changes too often. I don't know by how many times per second, it's causing the CPU of my system to constantly burn at 100% in a docker container. Due to this problem other services are prone to crash and thus renders Node Red unstable for productive use.

Here're a few flows to see how the CPU + LOAD is before and after: image

CPU is just bored, has nothing to do. LOAD is also extremely low: image

Now activating just one of your watch-directory node back ON, then waiting a minute to let the statistics normalize: image

The CPU usage spiked massively, and it's not going down anymore! Load time is also nearly at 2.

If I activate a 2nd 'watch-directory' node back on, CPU will ramp up even higher. LOAD time is now over 3: image

Would it be possible to implement a parameter, for example? Trigger Every: X Seconds / Minutes / Hours

CreativeWarlock commented 2 years ago

Never mind. I read here and on the NR forum that this project is no longer maintained and that there's a built-in node called "Watch" in Node Red. So, basically this project could as well be removed since many people seem to still download it every week.