3 ms·
FaaS is closer in mindset to CGI than fCGI : if you're gonna have a server accepting connections, you might as well accept HTTP connections. CGI and FaaS are mo
by rakoo 8y ago
FaaS is closer in mindset to CGI than fCGI : if you're gonna have a server accepting connections, you might as well accept HTTP connections. CGI and FaaS are more like developing a function that transforms a request into a response, and let the infra deal with the rest.
It is true though that it would be nice to have a standard for FaaS that doesn't have the inefficiency of CGI.
- icebraining 8y agoNah, it's FCGI because the process is kept "warm" and reused. It's much like the typical execution model of php-fpm.
- rakoo 8y agoThat the process is kept warm is an artifact of the infrastructure. As a Dev you absolutely don't care about how it's run and that's the whole point: just implement your business logic and the system takes care of the rest. As a dev it's all transparent.
- deleted 8y ago[deleted]
- icebraining 8y agoThat's actually less true of Lambda than of php-fpm. In Lambda, you can mutate the state of global variables between requests[1]; you have to take care not to do that. In php-fpm, all is thrown away. [1] http://blog.matthewdfuller.com/2015/12/aws-lambda-occasionally-reliable-caching.html http://blog.matthewdfuller.com/2015/12/aws-lambda-occasional...
- tyingq 8y agoThat's true for php-fpm, though many use something like apcu to cache state between requests. FCGI itself doesn't mandate that "thrown away globals" behavior. Golang under FGCI, for example, just spawns a goroutine for each new request.