-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Error: EMFILE: too many open files, open 'xxx.mdx' (x10) : Content and Pages at very large scale #7241
Comments
Similar discussion on stackoverflow https://stackoverflow.com/questions/8965606/node-and-error-emfile-too-many-open-files Using |
|
|
// astro.config.js
export default {
vite: {
server: {
watch: {
ignored: ['**/*']
}
}
}
} |
Not a solution : <= 5K = OK, >= 10K = KO
|
Tested 2.5.7 : Issue unchanged.<=15K files : Build oK but errpr thrown when accessing any page
|
[ 80K content Files ]
|
Can you provide an example project (git or stackblitz) that demonstrates this bug? Thanks. |
|
Looks like this continues to be a problem for people! I believe our type generation is reading all of the files in |
I'm facing the same issue, serving around ~1,500 markdown files. I use the Vercel adapter in SSR mode. If any of my pages (or components) reference the following Astro call, Vercel throws an HTTP 500, and I can find
Running Astro locally is working fine (I'm on macOS). Both Our setup is relatively new:
|
I'm hitting this issue on Windows with Astro 3.4.3 and about 10k files. I tried it with both Markdown content and JSON data content collections. I'm using static site mode and Also tried: Astro 3.5.3, with and without |
I'm getting this error periodically. And I have only 243 files in src/contents/ "astro": "^4.3.1", |
Can you try with the content layer (https://docs.astro.build/en/reference/configuration-reference/#experimentalcontentlayer)? That may solve it |
Closing this as there's been no response. If anyone has this, can they try using the latest beta of Astro and see if it still happens. We are working on making Astro more scalable for very large sites, and the content layer should help there. |
That makes sense. We're spinning up one-off Vite servers in some places and turning the watcher off could fix it. You can't shut it down entirely though since Vite always spins it up, but we can configure to ignore watching all files.
The issue is related with the number of files in 'src/content'. It apear when >= +-4000K with any Astro version. I am very new in the Astro community, coming fron ApostropheCMS eco-system. I am hoping to achieve a more reactive & lean alternative with astro & alpine as base. Unfortunately, the capacity to serve efficiently >= 1000K files is mandatory. Do you think Astro can help meet that content volume requirement ?
We should be able to but seeing that many files is a first for me so maybe we're not doing something right at that scale. However, I think it's diverging from the original issue so I'd suggest opening another issue if you can find out which Astro version starts causing issues. The errors you get are because some other dependencies rely on the latest version of Astro, so you might need to downgrade the others too.
Thanks for the update! I'll go ahead and get the fix out then.
Originally posted by @bluwy in #7073 (comment)
The text was updated successfully, but these errors were encountered: