Migration v2 to v3 increased the build time by 10+
Hi,
I was working on a Nuxt2 application.
For some reason, the project was forked and migrated to Nuxt3 few months ago.
Both project (Nuxt2 & Nuxt3) continued to receive updates.
As of today, the Nuxt2 application + a Laravel build is done in less than 2-3 minutes while the Nuxt3 application only (I separated the Laravel app build in the CI/CD) takes an average time of 15-25 minutes and sometimes even more 45!
The applications aren't build on equivalent hardware configuration: 8Gb ram, 4vCPU.
I trying to improve the performance of the Nuxt3 build during the CI/CD, copying the old node_modules folder from the previous build to not redownload already installed package, using pi0/nuxt-build-cache package and so on...
Is that normal that a Nuxt3 build takes way more time to run than Nuxt2?
Here are some results information of the builds:
Some of these numbers are really weird like it take 6 minutes to prerender one route?!
4 Replies
I almost doubled the server performance: now 16Gb RAM & 6vCPU, the build time remains the same: 16 minutes for the last build, and still that huge 251 seconds to prerender one route...
it should be the opposite, nuxt 3 is in most projects faster than nuxt 2 for the plain client/server build process
More info would help 🙂
What could help? Here are the full build log and my nuxt config.
https://gist.github.com/RomainMazB/fa9bbe28fcc8b33feb352b607b82e402
As a side note: I tried to build the app on my local machine, the build time is acceptable, like 3-4 minutes without all the cache optimization and so on...
This may have something with the server configuration, but why? What could cause the build time to be so long?
The CI process is ran by an hosted gitlab-runner, so there cpu/memory limitation is the machine one detailed earlier.
@manniL / TheAlexLichter just to inform you since you are most active than me here.
I tried a long shot this morning when discovered this gitlab runner issue: https://forum.gitlab.com/t/high-output-crashed-gitlab-runner-sync-with-gitlab-job/62068
I noticed that the gitlab instance actually crashed when nuxt was building, then it has to reboot and then continue the build (which is why the build time was so long).
I just modified my CI job to make it silent:
Now my app is built in less than 3 minutes 🙂
ah, interesting!
so the log overhead caused that long a build, crazy
thanks for sharing