Live data from Hacker News

Ask HN: What are the alternatives to Amazon Lambda?

news.ycombinator.com

51–60 of 78 posts

Re: Ask HN: What are the alternatives to Amazon Lambda?

#52
Depending on your use case and how much startup time you can tolerate...

We need the ability to run 1,000s to 100,000s of ~3 second jobs as fast as possible, but only sporadically (~100 times a day with our current customer base). At that "low" frequency, can't justify the cost of keeping that many dedicated servers up 24/7 to meet this intermittent need, and we need sub-second startup times so we can't launch normal VMs on demand.

However, the cost of servers on Google Compute Engine (GCE) is actually cheaper than lambda if you have big batches of jobs. The VMs could be launched via their autoscaler or Dataflow, and jobs could be dispatched via Pub/Sub. If you can secure enough preemptible GCE instances (which are of limited availability), these are even cheaper. GCE VMs launch in about a minute, compared to AWS's 3-7 minutes, so on-demand launching is actually doable for some use cases as long as you don't mind paying the 10 minute minimum. This also gives you access to huge resources (CPU and RAM) if needed.

Specifically, ~1.1 million 3300 ms 1536 mb lambda jobs cost us $90.04, and GCE would be $50 on regular or $15 on preemptible GCE VMs for the same number of jobs in the /same total execution time/. After requesting a Lambda quota of 100,000 concurrent jobs, we were only allowed 1,000 ("for now", they say) -- thus it takes an hour for that many jobs to complete, so GCE$ = (1 hr) * (cost per vCPU/hr) * (1000 vCPUs). Note that we're using the max allowable memory on Lambda because that ~linearly decreased our execution time, but we use an average of 400 mb. My estimate also doesn't take into account the overhead time that comes from launching lambda jobs that might be reduced via the home-brew solution I described above.

Someone else mentioned the issue with Lambda only having 0.10 vintage node. We have a somewhat complicated albeit elegant solution for communicating with a portable node 4.x binary via IPC. If AWS ever gets to allowing specified node versions, that would reduce our runtime marginally.

(BTW, I put in a feature request to GCE for a lambda-like service here: https://code.google.com/p/google-compute-engine/issues/detai...)

Re: Ask HN: What are the alternatives to Amazon Lambda?

#54
We've been hacking on something in this space for the past few months with StackHut - https://www.stackhut.com. We have a demo in a blog post at http://blog.stackhut.com/phantomjs-cloud/ showing headless web rendering-as-a-service.

We've tried to make it as simple as possible to get your code into the cloud. You write your classes and they're deployed as entrypoints into a lambda-esque service that you can call over JSON-RPC - making it trivial to write and deploy a backend.

As described in the blog, the great thing we think it has over tools like lambda is that you can describe your system declaratively, specifying any dependencies you may need, using a simple YAML file and it takes care of packaging your code. You can run this locally or deploy it to our hosted platform where it scales as needed.

Currently support JS and Python atm, and open-source at https://www.github.com/StackHut. We're super early but would love to hear your thoughts.

Re: Ask HN: What are the alternatives to Amazon Lambda?

#57
post #54

We've been hacking on something in this space for the past few months with StackHut - https://www.stackhut.com . We have a demo in a blog post at http://blog.stackhut.com/phantomjs-cloud/ showing headless web rendering-as-a-service. We've tried to make it as simple as possible to get your code into the cloud. You write your classes and they're deployed as entrypoints into a lambda-esque service that you can call over…

I've been using StackHut loads recently. Though it's more of a replacement for using AWS Lambda and AWS Gateway together.

There's a CLI tool and you can deploy literally any function you've declared locally which StackHut then automagically available through HTTP, no web server routing or request handling required (on server side at least).

It's a super fun idea and it's surprisingly easy to get started with. If you've got some free time this weekend, totally check it out.

Re: Ask HN: What are the alternatives to Amazon Lambda?

#58

One thing that strikes me as having really promising possibilities for doing something Lambda-esque is systemd socket activation [1]. You can essentially have no running services, and systemd will hold open a socket (port/unix/etc) and then it will spin up a given service if a request is made on that socket. As long as you build your "service" to handle a single request and shut down (maybe have an external db-access…

As others have said, this is basically what inetd and the likes have been doing for a long time. The reason why it isn't used for heavy services anymore is that every request will spawn a new process, and that's extremely expensive. That's like CGI at the socket level. The natural "solution" you have is to let your process run, and every time a new request comes from the network, it is merely redirected to your process, possibly under another format; that's FastCGI for you. But then you lose the simplicity of programming your process as if it were called for every request.

The real innovation that Lambda brings on the table is container reuse [1]. Basically your process is started in a container the very first time a request hits Lambda, and the initialization step happens; when it's done the container is "snapshotted" and runs the request. If the request has been completely processed, the process should normally close, but instead the container is kept hot for the next requests. If they come not too far away, the container will be reused, right after the snapshot, as if it was run for the first time.

Because of this trickery having many requests is not so expensive anymore, there can be very little latency. Bring that to everyone and inetd/xinetd/systemd's socket activation can be seriously considered as a viable solution.

[1] https://aws.amazon.com/blogs/compute/container-reuse-in-lamb...

Re: Ask HN: What are the alternatives to Amazon Lambda?

#59

I started trying to use Lambda and found a few immediate issues. 1) It does not work with anything inside VPC. EG: RDS Databases cannot be used. This severely limits why you'd use this on AWS for larger apps. 2) Trying to get it working for a real app is a bit of a gun show. Debugging was a pain, you cant really write any unit tests easily that I found. Local development was confusing. 3) Lambda forces you to use old…

RDS could be used. But not without weaken the security.

Re: Ask HN: What are the alternatives to Amazon Lambda?

#60
post #58

One thing that strikes me as having really promising possibilities for doing something Lambda-esque is systemd socket activation [1]. You can essentially have no running services, and systemd will hold open a socket (port/unix/etc) and then it will spin up a given service if a request is made on that socket. As long as you build your "service" to handle a single request and shut down (maybe have an external db-access…

As others have said, this is basically what inetd and the likes have been doing for a long time. The reason why it isn't used for heavy services anymore is that every request will spawn a new process, and that's extremely expensive. That's like CGI at the socket level. The natural "solution" you have is to let your process run, and every time a new request comes from the network, it is merely redirected to your proce…

Seems like you could essentially implement an LRU container/process/etc. keepalive on top of and have your machines essentially fully-utilized with minimal latency for services being accessed recently.
Post reply on HN