I know Hugo is advertised as being one of the fastest static website generators but what kind of hardware resources are being used when watching for changes? I plan on creating a service that will host many websites on the same server and auto build and deploy whenever a change is applied to either site. I’m just wondering how heavy this will become if there is a constant watch on hundreds of websites.
I don’t think anyone has tested it.
So, to get your answer … test it.
Hi,
The file watching in Hugo is courtesy of fsnotify, which wraps various OS-specific APIs. As such, it really depends on your deployment platform. Linux shouldn’t be much of a problem, but we haven’t done much in the way of CPU or memory profiling (contributions are welcome). I know the current Mac implementation has some severe limits in terms of number of files per process, and also does utilize a small amount of CPU/battery while just waiting (it could be better).
All that said, you may be able to completely sidestep hugo --watch
for your use case. Perhaps kicking off the build only when a deployment occurs, more along the lines of a Heroku deploy or continuous integration service.
The --watch
flag is really just intended for local development/writing.
Nathan.
Thanks for your insight and the info on fsnotify nathany.
“kicking off a build when a deployment occurs” is what i was originally planning on doing so i may just stick to that but if i decide on doing some performance profiling, i’ll be sure to post my results here.
My solution is to use CircleCI to do a build & deploy whenever I git push
to master. My sample setup is here: https://github.com/nathany/hugo-deploy
What did you end up doing?