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

run queries step much slower after v4.0.0-beta2 #107

Closed
bwlng opened this issue Jan 31, 2020 · 8 comments · Fixed by #114
Closed

run queries step much slower after v4.0.0-beta2 #107

bwlng opened this issue Jan 31, 2020 · 8 comments · Fixed by #114
Assignees

Comments

@bwlng
Copy link

bwlng commented Jan 31, 2020

After updating to v4.3.0 from 4.0.0-beta2, the step in gatsby build where queries are run is much slower. On our project w/ 2 languages enabled, builds go from 2.3 minutes to 11.6 minutes.

With everything else the same, downgrading the plugin back to 4.0.0-beta2 returns the build times to their prior level. With all languages enabled on our site, builds timeout in CI/CD environment at 90 minutes (builds are typically ~40 minutes).

I've tried Gatsby versions 2.17.5, 2.19.10, and a few in-between that are compatible w/ 4.3.0 and with each version, changing between the older version of gatsby-source-kontent and the latest produces the same slow/fast result. After further digging, it appears the slow down occurs between 4.0.0-beta2 and 4.0.0-beta4.

Is there any logging we can enable that would provide more insight into what is happening on this step? Is there something related to the generated schema that affects the step where queries are run?

Repro steps

  1. Run a build using v4.0.0-beta2 and record the time the build takes
  2. Run a build using v4.0.0-beta4 or newer and record the time the build takes

Expected behavior

Builds should take similar amounts of time

Test environment

  • Node v10.16.1
  • Gatsby v2.19.10
  • Gatsby Source Kontent v4.0.0-beta4 - v4.3
@bwlng bwlng changed the title run queries step much slower after v4.3.0 run queries step much slower after v4.0.0-beta2 Jan 31, 2020
@makma
Copy link
Contributor

makma commented Feb 3, 2020

Hi @bwlng thank you for letting us know, we are going to investigate this issue.

@makma
Copy link
Contributor

makma commented Feb 3, 2020

Hi @bwlng, I was not able to reproduce any significant performance/time differences between v 4.3.0 and 4.0.0-beta2 on my testing projects. Could you please provide me with your projectId on my email martinm@kentico.com so we can investigate this issue on your real project that causes the problem? Thank you!

@bwlng
Copy link
Author

bwlng commented Feb 3, 2020

Thanks for taking a look @makma. I emailed you my project ID. Let me know if there is any other info I can provide that would be helpful.

@makma
Copy link
Contributor

makma commented Feb 3, 2020

Hi @bwlng, I received your projectId. I'm gonna clone the project and try to reproduce the issue on my debug/dev environment. Thank you for the details. I'll keep you update.

@Simply007
Copy link
Contributor

See my comment, that might (just my guess) help with the performance #106 (comment).

@makma
Copy link
Contributor

makma commented Feb 19, 2020

I've got confirmed by guys from Gatsby that this issue is probably caused by GatsbyJS itself (and not by the source plugin) and is being fixed right now. I'll keep this issue open and will update the current status here.

@makma
Copy link
Contributor

makma commented Mar 4, 2020

Hi @bwlng, great news, the issue has been recently fixed in Gatsby package and the new version has been already released. I've been also able to test the fix and run queries step lasted 4sec on my environment on the provided reference project, for comparison, it had been more than 80sec before.

Just bump version for in you packages.json to "gatsby": "^2.19.28".

Edit: I'm also going to update version in the source plugin as well.

@makma makma self-assigned this Mar 4, 2020
This was referenced Mar 4, 2020
@makma makma closed this as completed in #114 Mar 4, 2020
@makma
Copy link
Contributor

makma commented Mar 4, 2020

The fix has also been released in gatsby-source-kontent v4.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants