Rethinking of CGI as a selfhosted lambda server
trusted-cgi.reddec.net
trusted-cgi.reddec.net
There is support for Ruby, Python, PHP, Java, Node, Go runtimes.
What's nice about it is that applications run unmodified.
uWSGI really is the swiss army toolchain for web operations.
Following is a general response for similar questions.
I pretty sure it's possible to do the same thing as trusted-cgi by combining several tools: cron + nginx/nginx-unit + some deployment + stats + whatever.
It could be faster, more flexible, but... I am not sure that I will personally want to setup it each time for new boxes. Or write auto-install scripts. I would like to write logic, not make environment.
Benefits trusted-cgi are: low resource usage (very low), easy setup, web UI and focus on including several features in one package.
It's possible to find better solutions for each parts, but I would like hear product that providing complete solution instead of providing "bricks". I am a big fan UNIX way, but sometimes we need an assembled thing, instead of another piece of constructor.
It does less than proper CGI, due to giving up HTTP (particularly response headers, status codes and content types) in order to process constrained JSON, and it does it in a more complicated way (UI? Scheduler? Git repositories?), but it's still better than other options.
I met a problem: low-end devices that should host a big number of small pieces of logic. To solve the problem I looked back to the history and found CGI and adapted it to the specific case.
As someone said before here in comments: it's just reinvented "good old technology", but I would like to say that I can't find anything bad in it. Old technology means a number of documentations, it means easy to explain.
Ofcourse there are number of issues caused the technology became outdated, but in some cases (defined in target audience) it acceptable. Even sometimes better than newer solutions.
More of that, if you will look at the modern technology (serverless functions/lambda functions) you probably will find the same ideas but wrapped into modern solutions (containers and cloud).
The process overhead was not a big deal even on 20yo hardware, and it saved us from dealing with all kinds of awful isolation issues. We discussed fastcgi or the like and dismissed it because the latency savings were much smaller than one might expect exactly for the reasons you mention: The problem was much less the process creation overhead than the overhead of dynamic runtimes.
People also seem to have forgotten what was expected back then. The time it takes to load Gmail for example would have been totally unacceptable. Our biggest latency limitation was not the web server / CGI, but optimizing the mail storage backends, so that is where we spent our effort.
Btw I am author of it and I will be happy to answer on any questions. Thanks for your interest!
Something like https://docs.microsoft.com/en-us/windows/win32/procthread/us...
Tell me more about why. The fork time isn't that many multiples more than spawning a thread. COW ensures you aren't using much more memory. You can always cap it at a pool of ~64 processes to handle requests.
People have used it in various segments, from actual deployments on push, to home automation, someone even wrote a guide on how to control the Xiaomi Robot Vacuum using the Amazon Dash button :-)
I would like to suggest to stop measure benefits of both projects and just "steal" them from each other, making end-user experience better for both projects ;-)
OpenFaaS has a single-binary distributable that doesn't require Docker/k8s they released called faasd:
ow.
It's a hodgepodge of different services.
https://github.com/silasb/lambda-engine https://github.com/silasb/lambda-scheduler https://github.com/silasb/deno-aws-lambda-example
Since this is a POC it's probably not worth looking at or trying to use as the instructions are in bad shape.
Hobby projects or projects with low number of requests are ideally fits. And it could be run on very low-end devices: raspberr pi, cheapest VPS, etc..
The language/platform/dependency freedom is what takes it from literal CGI script to lambda function.
I would've attributed them to CGI.
b) I couldn't figure out what this is. At first I thought it was computer graphics rendering (what "CGI" usually means), but after skimming several paragraphs I don't think that's what it is? But I'm still not sure.
c) Clicking the github link tries to download a .zip, which beyond making it harder to figure out what this is, was mildly distressing.
Edit: re: the downvotes, presumably the author would want to know that their site is broken on mobile and that the content is inaccessible to the average reader who might be curious to learn about it, in ways that could be easily remedied.
https://en.wikipedia.org/wiki/Common_Gateway_Interface
For many HNers, this is an understood term.
(One of the privileges of being a really big company is that you can name your products using common terms and take over that term. Like, "Windows". Even though Sun used that first.)