66 points · by madamelic · 9y ago · 35 comments
// Overly clever way of saying: increment `currentChunk` then use the incremented value
this.chunks[++currentChunk] = []
Pre- and post-increment operators are bread and butter in C, hardly overly clever. Are they a recent addition to JS? currentChunk++;
this.chunks[currentChunk] = [];
Which is perhaps what you meant all along. Please excuse the pedantry.I would really like AWS to have an event that fires when all the lambdas in a set have completed, but that doesn't seem to exist. Any suggestions?
https://cloudonaut.io/integrate-sqs-and-lambda-serverless-ar...
I guess the individual Lambdas could pop an "I'm done" message onto a FIFO queue. With a single Lambda consumer of that queue that updates an S3 bucket with a count. Done when count == 10,000. That's atomic, and no polling, but feels a bit smelly.
Again, I can't imagine why this would be useful, but it's a certain kind of fun to take Amazon's metaphor and run with it.
(It's also very hard to Google for "aws lambda partial application" and get results that match what I'm describing here.)
How is this working for you? Where do you see it going?
It actually works quite well. I use it for processing large amounts of data quickly. I originally built this to process some data that would've taken ~14 days and shortened to a few minutes (so nice!).
I enjoy using it when I can find a way to fit it into a project. I've had it internally for a month so not a whole lot of time to see it in a variety of projects.
In terms of where I see it going, I'm not entirely sure yet. It is pretty capable for what I am using it for currently, it can use node.js libraries so it fits the current needs (which are pretty basic). I'll see what happens when more people try it out. :)
Do you have any tips on what should be added, since you've been down this road before?
We end up with hundreds or thousands of Lambda invocations and the orchestrator is aware of all of them. If there's a failure in any lambda, I can stop the entire job and retry from scratch. The orchestrator knows exactly when the job is done so I can easily chain it together with some other non-Lambda job in my system.
Been working fine for us for ~200k invocations and 8k CPU minutes per day baseline with the ability to scale up to 10x that just by running more stuff. Our nightly job processes about 50gb of data in 3 min.
I would be interested, though, if anyone has figured out a way to raise the 30 second RequestResponse timeout. Both that and the 300s Lambda timeout are annoyingly low. Google is slightly better, they go to 600s!
Hmm. Are you saying you can queue additional jobs on the same worker to use up remaining execution time?
http://blog.codesolvent.com/2017/05/say-hello-to-solvent.htm...
:)
I originally wanted to name it unity-hivemind after I had watched Rick and Morty that weekend, but I figured the name was both a collision and a confusing due to the Unity graphics engine.