fastly/cli

--watch will error if the folder contains too many files

Opened this issue · 4 comments

My project has lots of files (214,269 files) and when I try and use the --watch mode, the cli will error

Version

❯ fastly version
Fastly CLI version v10.4.0 (4b869ab)
Built with go version go1.21.0 linux/amd64
Viceroy version: viceroy 0.7.0

What happened

I ran fastly compute serve --watch and had this error happen:

2023/09/06 02:20:55 error configuring watching for file changes: open polyfill-libraries/polyfill-library-3.52.1/polyfills/__dist/Intl.PluralRules.~locale.os: too many open files

@JakeChampion

214,269 files

Why Jake, why!? 😂

Nearly all of those files are used for KV Store entries ☺️

We typically recommend defining a .fastlyignore and adding patterns for files/directories to skip. I appreciate that's not going to necessarily help your particular issue though.

fgsch commented

Have you tried bumping your file descriptor limits (ulimit -n)? Even if this works I suspect keeping tabs of so many files is going to be very slow.