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

Cant build a blog with thousands of pages #729

Open
Faiiya opened this issue Oct 8, 2023 · 7 comments
Open

Cant build a blog with thousands of pages #729

Faiiya opened this issue Oct 8, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Faiiya
Copy link

Faiiya commented Oct 8, 2023

Describe the bug
I have a blog with around 12500 pages, all in mdx.
I have tried everything i can but it just refuses to build.
most of the time i get no error, others i get javascript heap out of memory, or yarn exit code 137
so seems to be memory related, i have tried to do it on vercel or with 16gb ram but no luck.
i have tried with a clean clone of this repo and just adding the blogs and it still fails.

To Reproduce
just clone the repo
create a big number of copies of a mdx article
and build

Expected behavior
i expect it to build

Screenshots

System Info (if dev / build issue):

  • Windows 11 WSL 2 with ubuntu
  • Node version 18.18
  • yarn v1.22.19
@Faiiya Faiiya added the bug Something isn't working label Oct 8, 2023
@timlrx
Copy link
Owner

timlrx commented Oct 9, 2023

I guess you have tested it for a small number of mdx files and it works? I have not tested it on so many mdx files.

@Faiiya
Copy link
Author

Faiiya commented Oct 9, 2023

yeah with small number of files it works, but someetimes it breaks with maybe 500.
the maximum i suceed building was with 4000 in vercel

@ttys3
Copy link
Contributor

ttys3 commented Oct 10, 2023

I have almost 400+ pages, sometimes it failed to build on Netlify

@timlrx
Copy link
Owner

timlrx commented Oct 11, 2023

Might be worth instrumenting it to see what is taking up the most memory / build time. I suspect it is the pre-rendering done on Next.js side which makes it hard to optimize. Maybe at 1000 pages+ it might be better to consider using server side rendering.

Anyone has a publicly available repo with that many pages?

@timlrx
Copy link
Owner

timlrx commented Oct 11, 2023

Re-reading this again and 12500 mdx pages really scares me - how do you even manage that 😆

At that scale, you should probably consider using a database backed CMS.

@Faiiya
Copy link
Author

Faiiya commented Oct 21, 2023

what cms do you recomend? , i dont need any editing or special tools, just simply host them and thats it.

after they are on the cms i should be able to do ISR wich should hopefully fix my problems right?

@ttys3
Copy link
Contributor

ttys3 commented Oct 30, 2023

image

I only have 100+ mdx:

❯ fd .mdx | wc -l 
135

and some tags.

deploy failed due to build failure.

I check local, I think it is because it uses more then 8GB memory

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants