Show HN: Servers.lol – Should Your EC2 Be a Lambda?
servers.lol
servers.lol
My aim was to host a Wordpress or Laravel site on AWS lambda without paying any monthly hosting charges. I got everything running on it (sessions, fs, request, etc).
Some things are different though, like when you write to a file using file_put_contents, etc it writes to a S3 bucket instead of fs (thanks to PHP's S3 wrapper), or when you create a session, it uses AWS DynamoDB to do that behind the scenes.
I've created some examples like this sign-in example which uses AWS Cognito + AWS lambda to create a login/signup page[2], file uploader, etc[3].
Of course my project was just for my own amusement but I think this can be good for side project where you just want to host something and forget about it.
[1] https://github.com/san-kumar/lambdaphp [2] https://www.lambdaphp.host/examples/auth/ [3] https://github.com/san-kumar/lambdaphp#examples
Only in preview, only in us-east-1, Aurora mysql flavor. Other regions/flavor to follow.
> The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month.
> The Lambda free tier does not automatically expire at the end of your 12 month AWS Free Tier term, but is available to both existing and new AWS customers indefinitely.
(emphasis added)
That is awesome. Providing you could get your application compatible with lambda. This application may help for WSGI-based (python) applications: https://github.com/Miserlou/Zappa
More on AWS Lambda: https://aws.amazon.com/lambda/
https://github.com/Miserlou/Zappa#asynchronous-task-executio...
:D
I know Erica at iOpipe and like what they are building. OpenFaaS is an alternative that can run on Docker or Kubernetes to provide a more flexible serverless environment with containers. Check it out https://www.openfaas.com
For me, I think Kubernetes + virtual kubelet (for container instance creation, with per second billing, only on Azure right now) is the safest option. It gives the benefit of easily scalable compute with no need to move to an event driven model or constraints on function duration and resource usage.
It will also support Kubernetes pods next year.
Disclaimer: I work for AWS.
S3stat's nightly job needs 60 or 70 hours to run, but it all has to happen in the few hours after Amazon finishes delivering logfiles for the day. So I spin up 15 or so machines as spot instances that churn through the queue then shut down.
This calculator tells me that should cost $600 or so per day, when reality it is more like $12. So even though it claims Lambda could do the same thing for $5, it'd take a long time to win back the engineering cost of making the switch. (A little over a month for every hour I spent working on it, it seems).
Trouble is, people don't seem to do that. I see a lot of 'Boss says use the cloud, lets just provision our current network in AWS 24/7'.
I kind of see serverless abd redshift as a workaround for the fact that users are currently mostly doing it wrong, and will eventually figure out that an always on cloud deployment is more expensive than just hiring server or colo.
Indeed, lambdas are worth considering for some but not all projects, and this tool seems helpful for people who may need a place to start researching their options.
In practice, all the serverless guys I've seen have a pre-CI pre-VCS pre-UAT kind of workflow using the AWS console where there's no change control or ability to collaborate.
* Dev: develop inside Docker container identical to Lambda environment https://github.com/lambci/docker-lambda
* CI: test via Jenkins/GoCD/Travis/CircleCI, inside docker
* Staging: deploy to staging host on merge
* UAT: against staging env, break build if any user-facing tests fail
* Prod: deploy exact same package we deployed to Staging
Disclaimer: I work for AWS
https://hackernoon.com/yubls-road-to-serverless-part-2-testi...
AWS also offers some of these pieces fully integrated via CodeDeploy (which we do not ourselves use).
Teams that have (only fairly recently) discovered AWS lets them escape the snail's pace of getting something into production within Enterprise IT, their little walled garden that IT has siloed them into (for their own good). They just absolutely love Node + Lambda because servers are scary (they tend not to have CLI skills to even CD / LS around the VFS) and it lets them get things done -- which is all their superiors value.
Places where IT doesn't value time to market, and nobody values maintenance or costs (we regularly have products owned by failing to apply patches to products using OSS, we rack up AWS bills by leaving manually created test resources around for months or ramping up products like Lambda to the moon for a batch job then forgetting to turn it back down once it finishes).
Once request volume goes up, instances are much cheaper.
So lambda makes sense for hobby stuff and those small services that you only use occasionally. And then again, the financial motivation probably have more to do with maintenance cost.
I suspect we’re paying a great deal more than that for EC2 but I don’t see those bills.
in all seriousness a very useful and cool tool. thanks for sharing!
i'd have picked a more informative domain; maybe serverless.info?
nice to know that is currently not cost effective for my workload.
- lambda = $3,327.05
- ec2 = $1,1146.24
I just don't get why anyone is using stuff like lambda for big projects unless they have extremely unpredictable and extremely spikey traffic.
Because any kind of sustained usage will quickly be cheaper to put on a nano instance and scale up from there.
Mainly because the pricing calculator from AWS is pure trash
You save your code to your Intel laptop, and it gets run.
Neither of us have the complete source code that is used to run that code. You have to be ok with that, and drawing a line in the sand at the hypervisor level just seems super arbitrary.
However what's really interesting is that it serialises any crash to S3 which you can then pull down and run/fix in your local Pharo debugger - https://twitter.com/martinfowler/status/897083875003969536?l...
And I'd move at least a couple personal projects there, instead of porting them to Node.
I know I'm in the minority, but there are dozens of us.
Over in Microsoft land, Azure Functions natively supports Powershell according to this blog post: https://david-obrien.net/2016/07/azure-functions-PowerShell/
That's condescending and inappropriate (since it knows nothing about "modernity" in architecture), at the same time.
I know that in my context, this has been a key issue. Another odd one is that our organization has only certified RHEL and Cent OS running server-side code.
Disclaimer: I work for AWS
This lets you run the same Lambda execution environment on any device you own. Typically, we see this being used by customers that need to do computing at the edge where Internet connectivity is poor or intermittent (think oil and gas fields, mines, etc.)
Disclaimer: I work for AWS