sci

doojin 2026-03-26T06:37:46.213369Z

I wanted to experiment with server-side HTML rendering in user-contributed SCI scripts. My current idea is to run one "synchronous" SCI script at a time in a vm context in each thread of a node.js worker process, have 3~5 threads in each process, and grow and shrink the worker pool size dynamically by monitoring CPU, memory, and worker utilization. In comparison to running as many SCI scripts as possible in each worker process of a fixed-size worker pool, this limits the blast radius of out-of-memory errors caused by poorly written scripts and malicious scripts. Problematic/malicious SCI scripts don't blow up many other SCI scripts. node.js process can impose a soft memory limit, and operating system can impose a hard memory limit for each process. node.js vm module enforces soft timeout. The master process kills a rendering process in the process pool if it exceeds hard timeout.