Running native PHP in AWS Lambda
Last year, i involved in agent commission system development like how insurance company or any other multilevel company does. End up, i stuck at a level where all big processes not optimized and not that stable.
Current configuration is using Google Cloud App Engine (GAE) with auto scaling. The main objective is to use big amount of RAM to complete all processes. By the time the commission process starts, GAE service will auto scale with CPU with matrix 20%. Means that, the service scalling once the CPU usage reach 20%. Just because it almost impossible to handle it in GAE properly as GAE Flex not allow zero minimum instance, i keep looking new solution until now.
Today, i found that Lambda can have 3GB RAM/15 minutes timeout to be used each invocation. Plus it able to run native PHP.
You can head straight to my repo https://github.com/ihsanberahim/boilerplate-lambda-php or down here the summary what or how to do.
Optional Prerequisite Steps
1. Prepare Instance
2. Compile PHP
Publishing Lambda Steps
1. Getting your AWS Credential
2. Configure AWS CLI
3. Create Layers
3. Create Functions
4. Invoke Functions
You also can refer official tutorial from aws
Soon i will reveal how to use lambda instead of using traditional Laravel Queue. It is exciting 2019 for me!