if we can't accept any more connections, don't poll the socket
luad
A server that provides pre-warmed Lua VMs to clients connecting over unix sockets
- no waiting for the interpeter to load
- share read-only pages between Lua processes
Lua is small enough that this is probably meaningless on any reasonably powerful computer, but conversely: Lua is useful on computers that are unreasonably feeble. This utility was written for Liminix, but it may be useful elsewhere too.
what it does
- start Lua
- accept unix datagram socket commands
- fork a child for each peer socket and run the requested lua script
how to use it
$ LUAD_SOCKET_PATH=/var/run/luad/socket luad prelude.lua
$ LUAD_SOCKET_PATH=/var/run/luad/socket luac script.lua arg1 arg2 ...
The pathname of a Lua script may optionally be passed to luad. It will be loaded into the interpreter before it is forked, so whatever it does will be available in the children.
small print
-
WIP. Not finished. Use at own risk, etc
-
tested only on Linux. Needs SCM_RIGHTS to send unix file descriptors across processes, which seems to be have implementation quirks on different unix flavours
Description
Languages
C
97.3%
Nix
1.8%
Makefile
0.9%