News for hackers. Stuff that matters.
Re:Serverless: slower and more expensive by scarface74 on Monday September 23, 2019 @06:24AM (#21047502)
Docker can also be serverless and gets rid of all the limitations of lambda - Fargate.
Re:Serverless: slower and more expensive by dragonelite on Monday September 23, 2019 @08:11AM (#21048114)
I tried using google cloud run, with a rust web server. I think google only counts request processing time and rounds up to the nearest 100ms.

All i had to do was provide a container with a web service that reads a environment variable to listen to a specific port.

Re:Serverless: slower and more expensive by snisarenko on Monday September 23, 2019 @11:41PM (#21056280)
I am considering using g cloud run for my next project. How did you like it ?
Re:Serverless: slower and more expensive by dragonelite on Tuesday September 24, 2019 @02:52AM (#21057247)
Too be honest it was really just a small project to get used with Actix web a rust web frame work and to setup a google cloud build ci/cd that would build a container i could host somewhere. I only used cloud run because i saw a youtube suggestion about it xD So there was no load except me and some friends pushing f5 a couple of times.

You can create a web service in whatever language and framework you want, all you need to do is read a PORT environment variable for incoming messages. The freedom was really awesome, instead of being confined to supported languages and frameworks you get in the functions landscape. Only confinement was that you're pretty much limited to HTTP calls, unless that has changed.

Personally i find the freedom of pick your own language and framework a big positive, and billing is finer on cloud run compared to AWS Fargate(rounded up to next sec) if im not mistaken. I do wish they would make billing even more finer instead of rounding up to the next 100 ms, rounding up to the next 10ms would be nicer when you use non GC or Runtimed languages, like Rust.

Re:Serverless: slower and more expensive by mywittyname on Monday September 23, 2019 @10:30AM (#21049225)
Fargate is not a replacement for Lambda. While there's some capability overlap, each have their own respective niches.
Re:Serverless: slower and more expensive by scarface74 on Monday September 23, 2019 @11:22AM (#21049728)
There is no reason that Fargate can not be a replacement for lambda.

There are three use cases for lambda:

1. Event based triggers where something happens externally that you want to process. You can do the same thing with Fargate by either having a continuously running process that reads from a queue or responds to an API request (AWS Event -> SNS -> API).

2. Timed events. You can do this with Fargate directly (https://aws.amazon.com/about-aws/whats-new/2018/08/aws-farga...)

3. APIs. Fargate supports autoscaling.

Fargate can do anything that lambda can do without the limitations - request and response payload size, a 10GB temporary storage drive instead of a half megabyte, and no 15 minute runtime limit. Of course no cold start times since you can have a minimum number of instances always running without Ping hacks.

Re:Serverless: slower and more expensive by mywittyname on Monday September 23, 2019 @01:36PM (#21051270)
Fargate is slow to spin up and can only run 50 simultaneous instances. But they can run "forever" and have much higher memory constraints.

Lambdas relatively fast to spin up and thousands instances can be run at once. But they are time limited running for at most 5 minutes and using 3GB of RAM.

You can do most of the same things with either (after all, they just execute code), but you cannot ignore their very different limitations and that they are conducive to different workloads.

Re:Serverless: slower and more expensive by scarface74 on Monday September 23, 2019 @01:55PM (#21051499)
The limit of 50 is a soft limit - you can send a support request to get it raised and they usually respond within a half an hour. Lambda also has a default soft limit of 2000.

But, also you can have up to 4 vCPUs with Fargate as opposed to one with lambda.

Re:Serverless: slower and more expensive by TheCoelacanth on Monday September 23, 2019 @12:38PM (#21050571)
And bare-metal servers can do everything Fargate can without limitations.

The point of both is to sacrifice some capabilities in order to remove operational complexity. Lambda just goes farther along that spectrum than Fargate does.

Re:Serverless: slower and more expensive by scarface74 on Monday September 23, 2019 @01:18PM (#21051024)
How so? With lambda you give AWS a zip file with your code in it and with Fargate you give AWS a Docker Container. The only difference is that AWS doesn’t support the event triggers with Fargate out of the box.
Re:Serverless: slower and more expensive by TheCoelacanth on Monday September 23, 2019 @06:44PM (#21054578)
A docker container is not just your code. It's basically the entire userspace portion of an OS plus your code.
Re:Serverless: slower and more expensive by scarface74 on Monday September 23, 2019 @07:38PM (#21054943)
It’s not any more “operationally complex”. The fact that Docker containers include the OS doesn’t make it more complex to run.

My Docker file that I used to convert my Node/Express API that was running in lambda consisted of...

- setting environment variables (I had to do the same thing in my CF template for lambda)

- retrieving the Node Docker image (one line of code - I had to specify one line of code in my CF template with lambda to specify that is was using the Node runtime)

- copying the files from the directory to the container (as opposed to specifying the locsl path of the source code in the CF Template)

- Specifying the Docker Run command (as opposed to specifying the lambda handler).

- running “Docker build” as opposed to “CloudFormation package”.

How it does it is an implementation detail.

In fact, if you use lambda layers, it’s almost equivalent to building Docker images.