Re:In The Works – Amazon Aurora Serverless
by lozenge on Wednesday November 29, 2017 @02:35PM
(#15810083)
You can't launch a persistent process on AWS Lambda.
[ Parent
| on HN ]
Re:In The Works – Amazon Aurora Serverless
by meritt on Wednesday November 29, 2017 @02:44PM
(#15810171)
You most definitely can. Lambda freezes the state of the container and thaws it for the next request (assuming the next request is relatively soon, otherwise it deletes the frozen instance entirely -- This is the entire premise behind keeping lambda functions "warm") including any background processes that might be running.
It's not persistent in that it exists between requests, but for the use case here it's exactly what is needed. He would save significant response time by having php-fpm already running, code parsed, opcodes cached and just issuing a new FCGI request to php-fpm instead of relaunching the PHP CLI each and every time.