Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Builds/Deploys faster #26

Open
ElijahLynn opened this issue Mar 23, 2020 · 5 comments
Open

Make Builds/Deploys faster #26

ElijahLynn opened this issue Mar 23, 2020 · 5 comments
Labels
Infrastructure Environments, builds, deployments, etc

Comments

@ElijahLynn
Copy link
Contributor

Current deploys and builds are taking 10+ minutes. I wonder if it something to do with shared workers on Netlify's side and if we can throw some $$ at the problem. This may not be the issue, but I do know that a fresh site should build/deploy in under 3 minutes.

Here is a sample log where we see 9 minutes in between boostrap and build steps with no information as to why the wait, which leads me to believe it is a Netlify worker. Maybe we can have our own dedicated worker?

2:58:49 PM: info bootstrap finished - 353.318 s
2:58:52 PM: warning Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade
3:00:10 PM: success Building production JavaScript and CSS bundles — 80.929 s
3:00:12 PM: { title: 'Get in touch',

image

@ElijahLynn ElijahLynn added the Infrastructure Environments, builds, deployments, etc label Mar 23, 2020
@ElijahLynn
Copy link
Contributor Author

Looks like we can add an extra build machine for $40/month, but the settings indicate we already have a build machine and are not at capacity.
image

I think we should open a support ticket.

@ElijahLynn
Copy link
Contributor Author

ElijahLynn commented Mar 23, 2020

Oh, I see now, gatsby build starts at 2:52:56 and then at 3:00:10 PM: success Building production JavaScript and CSS bundles — 80.929 s. Which 80s is not 8 minutes so I wonder if it is actually doing anything or just paused.

So next step is to see if gatsby build is that slow locally, and to use a debug flag to see what steps are being executed.

@DanielMiller-agile6
Copy link
Contributor

I tried this out as I was working on #24

With empty /.cache and /public folders, the build definitely takes a little while, but not nearly 10 minutes. With a hydrated cache, the builds run much faster. I'm guessing the build machine always starts with an empty cache?

By far, the most time consuming part of the build is the "Generating image thumbnails" step, so maybe this is also taking longer on the build machine than my laptop. Seems odd that the "bootstrap" phase on the build machine was taking > 300 seconds... on my machine it only took 4. Aside from hardware, we could also try to update our npm dependencies and see if there have been any performance improvements. A separate "dependency audit" issue would be useful regardless, since I noticed a few out-of-date and/or deprecated dependencies used in our site.

Below is the output from my local build:

Agile6-A14:AgileSix.com Daniel.Miller$ yarn build
yarn run v1.22.4
$ gatsby build
success open and validate gatsby-configs - 0.040s
success load plugins - 0.697s
warn The netlify-cms package is deprecated, please install netlify-cms-app instead. You can do this by running "npm install
success onPreInit - 0.015s
success delete html and css files from previous builds - 0.019s
success initialize cache - 0.018s
success copy gatsby files - 0.040s
success onPreBootstrap - 0.003s
success createSchemaCustomization - 0.009s
success source and transform nodes - 0.714s
success building schema - 0.247s
success createPages - 0.086s
success createPagesStatefully - 0.027s
success onPreExtractQueries - 0.002s
success update schema - 0.028s
success extract queries from components - 0.274s
success write out requires - 0.005s
success write out redirect data - 0.001s
success Build manifest and related icons - 0.137s
success onPostBootstrap - 0.141s
⠀
info bootstrap finished - 4.227 s
⠀
success Building production JavaScript and CSS bundles - 23.845s
success Rewriting compilation hashes - 0.007s
success run queries - 31.038s - 61/61 1.97/s
[============================]   103.652 s 270/270 100% Generating image thumbnails
[==                          ]   1.776 s 5/55 9% Building static HTML for pages
{ title: 'Get in touch',
success Building static HTML for pages - 2.098s - 55/55 26.21/s
success Generating image thumbnails - 103.984s - 270/270 2.60/s
Generated public/sw.js, which will precache 7 files, totaling 462092 bytes.
success onPostBuild - 0.081s
info Done building in 108.417 sec
✨  Done in 108.63s.

@DanielMiller-agile6
Copy link
Contributor

DanielMiller-agile6 commented May 12, 2020

I just saw an email about "Gatsby Incremental Builds" for Netlify. Might be worth trying out:

https://www.netlify.com/blog/2020/04/23/enable-gatsby-incremental-builds-on-netlify

@ElijahLynn
Copy link
Contributor Author

Thanks for testing this and adding more info. I am down for trying the incremental builds on Netlify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Environments, builds, deployments, etc
Projects
None yet
Development

No branches or pull requests

2 participants