Hello! I work for a company as an instructor where we teach residents inside Correctional Facilities how to code. I apologize if this forum post steps over a line about information requesting on how FCC handles deployments or something similar. We have used an older version of FreeCodeCamp with custom auth procedures for many years now and it has been outdated for a long time. I have stepped up to the plate to make a new version of it using current repository information.
I have everything working so far aside from one issue. There is a memory overflow when running pnpm run start-ci, (gatsby exits with EMFILE: too many open files, open ‘\client\public\404.html’) or even pnpm run develop (which we originally thought was due to verbose logging, but appears to be the same problem, especially since we have 20 concurrent users).
The 404 is being called from transformers.js on line 273: frame.contentDocument.documentElement.innerHTML = contents;. When the challenge is a multifile challenge and the link to styles.css is present, the client will try asking gatsby for the file in four different ways (as viewed through procmon.exe) before returning a 404.html file. However, due to the concurrency and the frequency of students updating their iframes as they type, we are reaching memory heap issues within about 3 hours or so (two times a class). I have tried adding a redirect in serve.json, and I have not noticed any relief of requests (in fact, page-data and app-data started being called at the end of challenge paths as well). I also added a ServiceWorker to handle requests to styles.css and force cancel them, but the classroom environment is on VLAN, so there is no https protocol implemented and the Service Workers will not run because of security protocols. As a last resort, I tried kubernetes to do load balancing, but I’m hitting a dead end with it as it is out of my expertise (I have not worked with it much in the past, sadly).
This issue is not just restricted to our runtime, analyzing the network requests across the production version of FreeCodeCamp shows the same attempts. I am wondering what is done on your end to prevent the overflow, especially as you scale up?
We are working in Windows 11 with everything else installed according to the contribution guide for setting up locally, no challenge or user storage logic has been touched, just CSS, components, and authentication/session logic. We can move over to a cloud provider once items work as expected, we also have docker available to us.
Thank you in advance for any advice you can offer, and I greatly appreciate you taking the time to read it! If anything doesn’t make sense, let me know and I will try my best to append those changes.
TL;DR: Sorry if in the wrong category, but I am having memory heap crashes on 20 user environments and am looking for possible solutions to this problem.