As of a few days ago, Wasmjit is able to run Nginx 1.15.3 in
user space. This means you can use Wasmjit to run the same
on all POSIX systems. So far it’s been tested on Linux, OpenBSD, and
macOS. It’s not a stripped down version of Nginx: it’s the whole
thing, compiled straight from source without modification and
with multi-process capability. All the complex bits of the POSIX API
required for Nginx have been implemented, including signal handling
Kernel space support still requires more work. Emscripten delegates
certain large APIs like
strftime() to the host
implementation, and these would require re-implementation in the
kernel. In addition, implementing kernel space versions of
execve(), and signal handling still needs to be done. We will
publish performance benchmarks when this work is completed.
Since its inception in late July, getting Nginx to run on Wasmjit has been a primary goal. While it might be convenient to run the same binary on multiple systems without modification (“write once, run anywhere”), this goal was chosen because IO-bound / system call heavy servers stand to gain the most by running in kernel space. Running FUSE file systems in kernel space is another motivating use case that Wasmjit will soon support.
Wasmjit is still alpha-level software in development. Don’t use it in production unless you’re willing to deal with unpredictable circumstances. If you want it to become production-ready software, don’t hesitate to get in touch.