News for hackers. Stuff that matters.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by ak217 on Thursday September 28, 2017 @06:32PM (#15361328)
FYI, I believe you can disable retries and replace them with a DLQ (which you can then ignore, if you don't care about failures).

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!

Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by teej on Thursday September 28, 2017 @07:06PM (#15361522)
At my company we created a queue for Lambdas. The pattern we use is to monitor the execution time left and queue up a follow-up once there's <30s left. Not every job we do can be composed this way but it helps a lot.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by madamelic on Thursday September 28, 2017 @07:45PM (#15361711)
>The pattern we use is to monitor the execution time left and queue up a follow-up once there's <30s left. Not every job we do can be composed this way but it helps a lot.

Hmm. Are you saying you can queue additional jobs on the same worker to use up remaining execution time?

Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by teej on Thursday September 28, 2017 @07:56PM (#15361753)
Amazon doesnt really give you any direct access to the underlying "worker" so it doesnt work like that. It's really as simple as:

- the active lambda decides to stop performing work once there's only 30 seconds left

- it switches to perform whatever cleanup is necessary

- it queues up a new lambda to be executed by pushing the lambda name and event payload to redis

- I have a special lambda that's scheduled for once a minute that scans certain keys in redis, pops the data out, and invokes the lambdas

To give an example, I have a job where I need to read ~50 files in S3 line by line and do some work over them. I spin up 50 lambdas, one for each file. Each lambda chugs along until it is about to run out of time. It then queues up a followup lambda with the byte # to start at in the event payload. The followup lambda then picks up where the last one left off.

I have some cases where instead of queueing up the followup lambda I just invoke it directly. The value in having a queue step in between is that you can more cleanly handle throttling and you can avoid event payload limits by just putting the payload into Redis.

Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by madamelic on Friday September 29, 2017 @08:33AM (#15364655)
That's... really awesome. I think that may have to be a follow-up feature for this project.

Thanks!