3 ms·
I would like a super lightweight host process for interpreters that is similar to php-fpm and Erlang but can have shared state for database connections but the
by samsquire 3y ago
I would like a super lightweight host process for interpreters that is similar to php-fpm and Erlang but can have shared state for database connections but the main interpreter is not a separate process but simply a function call.
Serverless and WASM runtimes are similar and Firecracker are in this space.
It would have to be multithreaded, it could communicate with nginx via domain socket as php-fpm does. I don't know if there's a way to multiplex data over a domain socket, maybe you could use multiple domain sockets and load balance between them? Or custom framing.
Does head of line blocking come into this too?
- synergy20 3y agoisn't this fastcgi? or python app server?
- rav 3y ago> can have shared state for database connections but the main interpreter is not a separate process but simply a function call. > It would have to be multithreaded, it could communicate with nginx via domain socket as php-fpm does. If we define the communication with nginx over domain socket to be HTTP/1.1, then you have basically reinvented Rails / Flask / Django / Hyper / ... - you can define each script as a Python/Ruby/Rust function and everything runs in shared processes so you can cache database connections and other things if you fancy.
- geenat 3y ago>I would like a super lightweight host process for interpreters that is similar to php-fpm This. It's an area where PHP really pulls ahead. php-fpm has preload, persistent db connections, worker pre-warm, etc. all built in- all of these optimisations combined makes CGI very viable.