Performance Tuning #1080
-
Hi Razon & Community, how to tune build performance? I've read that "caching" for templates may help, and maybe some tuning for taxonomy parameters? I've read in may boost build time 4 times; I currently have site with 6000 pages at Netlify, and build takes 40 minutes with "--minify" option, with all default settings as in site template. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 21 comments 25 replies
-
6000 pages tooks 40min sounds very very very slow... The HB framework docs site is about 6k pages, but it take less than 2min (took 3min to deploy completely), you can check the latest workflow log here. There are some hints to improve build performance.
|
Beta Was this translation helpful? Give feedback.
-
Btw, I'd recommend creating a minimal repo for checking if the caching is working, otherwise you'll exceed the limit of your Netlify plan soon enough and generate costs. Or using GitHub Actions instead if your repo is public, GitHub Actions is free for public repo. |
Beta Was this translation helpful? Give feedback.
-
On my laptop it is slow too, Apple M1 Max 64Gb, 25+ minutes What I found is mentions about templates/layout caching; not about GitHub roundtrips. 6,000 primary pages; but with pagination etc. much more; measuring now |
Beta Was this translation helpful? Give feedback.
-
https://discourse.gohugo.io/t/hugo-build-takes-too-long/28787/5 |
Beta Was this translation helpful? Give feedback.
-
using
|
Beta Was this translation helpful? Give feedback.
-
Thanks Razon, here is new log, huge numbers, I'll try to disable "search" and rerun,
|
Beta Was this translation helpful? Give feedback.
-
I'll provide repo access tomorrow; good night |
Beta Was this translation helpful? Give feedback.
-
"_default/term.html" in the logs above is "terms" generation, and as I found it is for Taxonomies. The issue is with taxonomies; it is also seen from logs; when I disable both, Categories, and Tags, it is 15 seconds (instead of 800 seconds). When I enable Categories only, it is 50 seconds. I have mess with tags, few forms of the same word (plural, singular, etc.); I am going to disable tags for my site; I need Categories, and Related Terms (and "related terms" is not really "tag"; "profit" is term related to "loss" for example) |
Beta Was this translation helpful? Give feedback.
-
Hi Razon, I added you to https://github.com/tokenizer-inc-canada/www.tokenizer.ca
This repo currently has "tags" enabled (if I disable it, Google Search will have issues with 404 errors); on my laptop, full build takes 20-30 minutes, on Netlify - 30 minutes (and if I enable "--minify" it will be 35-40 minutes) When I disable "tags" (but leave "categories" enabled) build takes 50 seconds on laptop!!! My plan is to write program which will do statistical analysis and remove "least frequent tags" and also normalize words: "Equities, Equity, equities, equity -> equity", and if I have category "Equity" I shouldn't have such tag. Automated tool can do that... 6000+ pages. Also, https://tokenizer.ca/tags/ page is extremely huge and Chrome simply throws error, I am searching a way to limit its' size. Thanks, |
Beta Was this translation helpful? Give feedback.
-
I tried improved version with Netlify, with "minify" enabled, build takes 26 minutes now instead of previous 38, this is significant, thank you! |
Beta Was this translation helpful? Give feedback.
-
Just made some significant improvement, now it takes 6min to generate 37k pages, build speed is good now, less than 10ms per page. Upgrade via I'm closing this for now, no much things can be improved, ideas are welcome if you found any. You can remove me from your repo now. |
Beta Was this translation helpful? Give feedback.
-
Btw, you can use
|
Beta Was this translation helpful? Give feedback.
-
Made some changes, which may save 1min for your case. This might be last reply on this topic, keep modules up to date is always recommended. |
Beta Was this translation helpful? Give feedback.
-
I am not sure why, but one of my sites has this error now:
|
Beta Was this translation helpful? Give feedback.
-
Build failed after 40 minutes, I think it is "search" module so I am disabling it:
|
Beta Was this translation helpful? Give feedback.
-
Yes I found what caused that, I found it after disabling "Search". It was "#" in keywords section of frontmatter, such as
I'll try to enable search and to rerun, I think "search" was in a loop because of that. Netlify filesystem doesn't support "#" as a starting character of generated file. I didn't have this issue locally. |
Beta Was this translation helpful? Give feedback.
-
From the docs, I found this:
Trying it now... it works locally. |
Beta Was this translation helpful? Give feedback.
-
Yes, it works now; I had Full build at Netlify with Search enabled and upgraded libraries took 45 minutes; it is large site. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I can try this, https://gohugo.io/getting-started/configuration/#disablealiases I think Hugo can monitor changes and generate aliases (301 redirects, etc) - Netlify specific; but on my laptop, clean build, I had zero files, then 13,000 iles, so it generates 13,000 aliases I can try to disable it to test |
Beta Was this translation helpful? Give feedback.
-
Here is my largest site, built on Macbook Pro M1,
"Categories" taxonomy enabled, and pagination is by 1000 pages. About 17ms/page. If I disable "category" taxonomy, it will become less than 5ms/page. |
Beta Was this translation helpful? Give feedback.
Just made some significant improvement, now it takes 6min to generate 37k pages, build speed is good now, less than 10ms per page.
Upgrade via
hugo mod get -u
.I'm closing this for now, no much things can be improved, ideas are welcome if you found any.
You can remove me from your repo now.