News for hackers. Stuff that matters.
Re:Serverless: slower and more expensive by kstrauser on Monday September 23, 2019 @11:06AM (#21049578)
An example of where serverless is lovely for us:

We run on AWS. We log lots of stuff to CloudWatch. CloudWatch allows you to scan for regexps (more or less) and send matching lines to a destination of your choosing. There are about 5-10 such matching events per day that we care about, and when they happen, we want an alert in a Slack channel (or email or text or PagerDuty or...).

Option A:

Stand up a server. Deploy a web service on it that accepts POSTs from CloudWatch and acts on them. Update the box as OS vulnerabilities come along. Pay 24/7 for a server that accepts 10 incoming requests per day.

Option B:

Write a plain Python function that takes the contents of a POST that's already been processed and has no other idea that it's living behind a web server. Drop it in Lambda. Pay for 1000ms of processing time per day.

I wouldn't want to run our entire stack on Lambda and friends, but for certain specific situations it's brilliant and I wouldn't want to give it up.

Re:Serverless: slower and more expensive by mytailorisrich on Monday September 23, 2019 @11:32AM (#21049858)
If you have spare capacity on a server you can probably squeeze in such functionality at no extra cost.
Re:Serverless: slower and more expensive by kstrauser on Monday September 23, 2019 @11:53AM (#21050053)
But that makes operational expenses go up. For instance, now you have to tweak the Nginx config to support the service that normally lives on that machine and the new system. And you still have to write and maintain the web service driving it (which may not be hard, like a Flask app with a single route, but still more than zero). And you still have to maintain the server itself, which should involve regular OS updates and any work you have to do to automate deployment of the web service, unless you really like doing all that stuff by hand.

Or you can upload a single function definition to Lambda and let it do everything else.

Again, I wouldn't use Lambda for everything, but I'll gladly let it handle the stuff I won't want to bother with.

Re:Serverless: slower and more expensive by EpicEng on Monday September 23, 2019 @03:18PM (#21052515)
>But that makes operational expenses go up

On the other hand, you're probably all set up to do that already. It's no big deal. Introducing a new tech requires training, new deployment procedures, new documentation, etc., and now you probably have a one off component out there. There's a line somewhere, but if I were just adding a webhook for log events I'd throw it on a server I already have.

Re:Serverless: slower and more expensive by lallysingh on Monday September 23, 2019 @11:50AM (#21050022)
It's almost never about server capacity. It's usually about who's maintaining them, who controls the updates and versions of software on there, and which dept the server's billed to. All stuff that's reasonable for things of a certain size, but unreasonable for things too small or big to fit the process will.
Re:Serverless: slower and more expensive by mytailorisrich on Monday September 23, 2019 @11:52AM (#21050039)
Ah so it's serverless as a tool to work around corporate red tape, then ;)
Re:Serverless: slower and more expensive by smacktoward on Monday September 23, 2019 @01:57PM (#21051537)
I would love to see a study of how much IT spending in general is just for tools to work around corporate bureaucracy. I suspect the figure would be staggering.
Re:Serverless: slower and more expensive by jimbokun on Monday September 23, 2019 @03:51PM (#21052851)
A market that will never die!
Re:Serverless: slower and more expensive by richmarr on Monday September 23, 2019 @12:30PM (#21050461)
> ...at no extra cost

Complexity and dependency are costs too, and I would argue often more significant costs than the $30/month to run a server.

[dead]
Re:Serverless: slower and more expensive by kstrauser on Monday September 23, 2019 @01:28PM (#21051161)
Yep, you figured me out. Drat!
Re:Serverless: slower and more expensive by stevofolife on Monday September 23, 2019 @02:23PM (#21051857)
How can cgi-bin in Nginx help in his case?
Re:Serverless: slower and more expensive by kragen on Monday September 23, 2019 @04:54PM (#21053516)
Option A above requires standing up a new server. Option B involves just writing a short piece of code that handles a form POST and uploading it to a server (in that case, Amazon's). Option C, "If you have spare capacity on a server you can probably squeeze in such functionality at no extra cost," has the following disadvantages, according to him: "Now you have to tweak the Nginx config to support the service that normally lives on that machine and the new system. And you still have to write and maintain the web service driving it (which may not be hard, like a Flask app with a single route, but still more than zero)."

But a CGI program, assuming you have cgi-bin already configured, gives you the benefits of option B without the drawbacks of option C: you don't need a Flask app or a route or a configuration tweak. You just write a short piece of code that handles a form POST and upload it to a server. The difference is that it's your server, not Amazon's, and you have to put this at the top of your code:

    #!/usr/bin/python
    import cgi
    qs = cgi.parse()
Then you can version-control it in Git so that when you need to figure out what broke last week you don't depend on AWS deployment logs.

Like, literally, the drawbacks of "serverless" that are being cited in this discussion (startup time and performance cost) are the reasons we moved away from CGI in the late 1990s, and literally every single advantage being cited for "serverless" in this discussion is also an advantage of CGI. "Serverless" also has disadvantages of vendor lock-in, lack of programming-language choice, and difficulty of monitoring and debugging that don't exist with CGI, but those aren't coming up much in this discussion.

The only real advantage seems to be if you can get by with literally zero servers of your own, thus saving the US$5 a month you would spend on a low-end VPS to run your potentially dozens of CGI scripts under Nginx, maybe inside Docker. In that case maybe you should look into shared web hosting. Or possibly get a job, if that's a possibility.

I'm not saying "serverless" isn't a good idea or that it isn't an improvement on CGI. The CGI interface is kind of sketchy and it's produced a lot of bugs in the past. It would be easy to do better, especially with a native-language binding. But the reasons we abandoned CGI are also reasons to abandon "serverless", and the actual advantages of "serverless" (if they exist) are not coming up in this discussion.

Re:Serverless: slower and more expensive by kstrauser on Monday September 23, 2019 @03:51PM (#21052848)
Narrator: It can’t.

Well, it can, but that’s the trivial part of all this. Tweaking a web server config is like 1% of the problem.