docker-tools icon indicating copy to clipboard operation
docker-tools copied to clipboard

Investigate using watchexec as possible replacement for Watch-Directory tight loop running ROBOCOPY

Open pbering opened this issue 4 years ago • 0 comments

Local tests of https://github.com/watchexec/watchexec shows promising results as a possible replacement of https://github.com/Sitecore/docker-tools/blob/main/image/src/scripts/Watch-Directory.ps1#L185. The current loop uses 2-3% CPU when idle where watchexec uses 0.

Other observations while testing watchexec:

  1. It uses less that 1 MB of memory.
  2. Watching an average Sitecore web application project / deploy folder it seems very good to batch events so it does not trigger too many times.
  3. Default ignoring glob patters defined in .gitignore and supports excluding/including files/folder from parameters.

We need to test this in a container to:

  1. See if it work at all since it is based on file events from the OS which can work behave differently in a container.
  2. Measure idle CPU usage / memory to see if there is actual benefits by switching.

pbering avatar Feb 02 '21 18:02 pbering