8 ms·
AWS Lambda: Run Java Code in Response to Events
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- whateveracct 11y agoIt looks like this just needs a jar, so any JVM language with better FP support would also work. There is a limit on JAR size though: > Note that deployment packages uploaded to Lambda are limited to 50 MB
- zrail 11y agoThat's really interesting. The JRuby 9.0rc1 binary tarball is 41M, which means, theoretically, if you didn't package too many additional gems, you could write your lambdas in ruby!
- jeffbarr 11y agoI would love to hear about some success stories that involve alternate languages on the JVM. If the 50 MB limit proves to be restrictive, please let me know!
- aaronharnly 11y agoAs an example of a use case that fails with the 50MB limit, I'd love to be running Clojure code on Lambda that depends on the Stanford NLP toolkit[1], the minimal form of which is 260MB. (To examine student writing and make useful suggestions to teachers, if you're curious.) [1] http://nlp.stanford.edu/software/corenlp.shtml http://nlp.stanford.edu/software/corenlp.shtml
- alexatkeplar 11y agoI've just put together a quick Scala fatjar containing just Scala 2.11.5 and json4s (which has a fair few dependencies), and that came in at 27,369,865 bytes, so all looks promising for Scala lambdas!
- kanwisher 11y agoThis is for Amazon Lambda service, not java 8 lambdas
- GauntletWizard 11y agoJava lambdas have nothing to do with this feature. This allows you to write a function that is evaluated by a lambda handler; You write only the innermost bit (i.e. "{System.out.println(eachperson)}")
- weego 11y agoI couldn't see anything on timings here compared to the node version. Does it keep the code 'hot' or is there the cold start overhead? I assume it has to be the former for this to be at all viable.
- wnevets 11y agoI'm pretty high on AWS Lambda right now. Setting and forgetting is so nice.
- PretzelFisch 11y agoI find the idea very appealing, but it seems like it would lead to micro service hell. How are you managing the Lambdas for test and deployment?
- ajaynairataws 11y agoA few options - Codeship (https://blog.codeship.com/integrating-aws-lambda-with-codeship/ https://blog.codeship.com/integrating-aws-lambda-with-codesh...), popular community extensions such as Kappa (https://github.com/garnaat/kappa https://github.com/garnaat/kappa) Jenkins plugins (https://wiki.jenkins-ci.org/display/JENKINS/AWS+Lambda+Plugin https://wiki.jenkins-ci.org/display/JENKINS/AWS+Lambda+Plugi...) and Grunt plugins (https://github.com/Tim-B/grunt-aws-lambda/commits/master/package.json https://github.com/Tim-B/grunt-aws-lambda/commits/master/pac...) that you can use as part of your CI/CD pipelines. There was even recent blogpost about using Lambda to deploy Lambda functions :) (https://aws.amazon.com/blogs/compute/new-deployment-options-for-aws-lambda/ https://aws.amazon.com/blogs/compute/new-deployment-options-...). Would be great to hear what else you would like to see.
- cddotdotslash 11y agoJenkins has a Lambda plugin now so I've setup the typical GitHub Branch > Webhook > Jenkins > Lambda workflow. Push to a stage branch, the function is updated pretty quickly. Test then push to prod.
- pramodliv1 11y agoHas anyone used IronWorker in production? It seems to be more flexible than AWS Lambda. http://blog.iron.io/2015/01/aws-lambda-vs-ironworker.html http://blog.iron.io/2015/01/aws-lambda-vs-ironworker.html
- stephenitis 11y agoHere are a few updated differences. disclosure I work for Iron.io Lambda: node, java IronWorker: node, ruby, python, php, java, binaries, .NET, go (binaries), and more (specific language runtime versions available) Lambda: allows 500mb of local disk space to persist your task IronWorker: 10 gb of local disk space available Lambda: only current version of code IronWorker: versions all uploads and allows you to revert Lambda: no built in scheduler IronWorker: a flexible scheduler out of the box to run tasks Lambda: maximum execution time 60 seconds IronWorker:maximum execution time 1 hour (customizable up to 24 hours for dedicated users) Lambda: 100 maximum concurrent request. (The maximum can be higher, can someone point me to the absolute maximum if it exist?) IronWorker: concurrency maximum can go much higher as needed (250 for a production plan). You can also limit concurrency per IronWorker, aka set a worker to only run up to 50 concurrent tasks. (useful if you have bottlenecks) Lambda: 90 inactive code retention period IronWorker: no limit to inactive code retention period Lambda: available on aws IronWorker: choose your cloud provider: AWS, Rackspace, Microsoft Azure, private clouds, and more. We've also enabled users to pause the execution of their task queue incase they need to patch or revise their worker code. supporting your own docker images http://blog.iron.io/2015/06/no-lock-in-thanks-to-docker.html http://blog.iron.io/2015/06/no-lock-in-thanks-to-docker.html http://blog.iron.io/2015/05/full-docker-support-for-ironworker.html http://blog.iron.io/2015/05/full-docker-support-for-ironwork... We’ve been doing some very neat stuff with our local docker development workflow https://medium.com/@treeder/why-and-how-to-use-docker-for-development-a156c1de3b24 https://medium.com/@treeder/why-and-how-to-use-docker-for-de... edits* formatting Overall we are are glad Lambda is validating workflows around eventable compute services. It's an experience we've been innovating for some time now.
- dsjoerg 11y agoThanks for the comparison. Regarding Lambda maximum concurrency, I am currently configured for a limit of 20,000 concurrent invokes so perhaps your figure of 100 is not the maximum but simply the default maximum?
- michaelvkpdx 11y agoBut wait... didn't the "What Is Code?" thing say that Java is just for white-collar IT workers? If you've got Node.js, why would you ever need Java? Yes, I'm being sarcastic.
- deleted 11y ago[deleted]
- fwoqpdw 11y agoI tried out lambda to handle backend requests with a go executable. For a trivial request/response it took 100-300 ms for the first request and 3-100 ms for subsequent requests. Using better hardware tended to help with the subsequent requests but there was still a lot of variance. This is too slow and has too much variance for my purposes, which is to respond to user events. Even if I added an optimization of having a go process which lives through multiple lambda calls, the first request latency sucks. (And I haven't verified that the optimization would work - unfortunately you can't use sockets which would make it simpler). TL;DR: pls support go (with consistent performance)
- siscia 11y agoWhat would be "fast" in your opinion ?
- fwoqpdw 11y agoConsistency is more of an issue with me than speed. That said, I would be happy if a trivial request (prints a short line of output) to a go handler would consistently be <10ms.
- siscia 11y agoI am sorry but 10ms is really too short... You need to consider physical latency into the equation... If you live next to a Amazon data center you can hope to achieve such result, otherwise...
- encoderer 11y agoThis is a great blog for all things AWS Lambda: https://alestic.com/ https://alestic.com/ The author is popular in the AWS developer community, and he's a really good guy to work with.
- deleted 11y ago[deleted]
- siscia 11y agoWhat HN dislike about AWS Lambda ?
- akhatri_aus 11y agoLack of support for proper sockets is a real bummer. If binaries can't be used or talk to the app the applications are quite limited.
- SomeStupidPoint 11y agoI guess I'm not understanding why you'd use lambda that way instead of just using container instances -- what would be the point?
- akhatri_aus 11y agoThere are tasks to be done that require binaries. Typically 1 second tasks. This binary needs to interact with Java or NodeJS so it uses sockets [creates a server and nodejs connects to it to tell it what to do] for the request. A container seems silly since its a sub 1 second task
- siscia 11y agoCan you elaborate ? You want socket just to bring down latency ? You want different client to connect to the same environment so that you can keep a local state of your application ? I am thinking about a videogame or a collaborative office tool. You simply want to send binary data to a function ?
- akhatri_aus 11y agoLambda is great for doing lots of tasks in bulk. Say I have a binary that is able to process data quickly. On a lambda request nodejs instructs a binary on what to do using a socket. Meaning it binds to a local port and interacts with the binary getting and receiving instructions until the task is complete. In all sub 1 second. Lambda doesn't allow sockets so its uses are very limited. Binaries also cut down the time it takes to do a task and allow a greater variety of things to be done.
- IanCal 11y agoGreat to see it move on from just JS (although I know you can run binaries, it's a little awkward). There was a 60s execution limit in preview, anyone know if thats still around / likely to change? I've got a task to solve a the moment which is basically "When a user puts a file on S3, hit an API for each line, store all responses in S3" Lambda would be awesome for the low end of that, small files would generally be alright, but as the filesize grows I'd need to try and setup workflows to split the file & rejoin the results (and guess how many requests I can make in 60s) which is starting to get into a more complicated setup than I'd really want so I'd be likely to just rent a machine and setup my own queue processing (again more complicated, but more in my control). Maybe I'm actually just looking for simple grid software and I should just rent some servers. Essentially, what I'd like to use lambda for is "Run this code. It's not big or heavy, or requires much power, but run it and stop charging me when it finishes". I don't want to request machines, setup disks, compare multiple reserved costs, orchestrate them starting & stopping or handle updating them, and I don't want to worry about starting 100 5s jobs and that costing me 100 hours. I'm aware that's rather "moon on a stick", but I do feel like a lot of this is almost there. I'm missing a big hole in my toolbox since PiCloud shut down. Millisecond pricing, tasks, queues, workflows, custom environments. Anyone here an old picloud user? What have you moved to? GCE is interesting, with fast boot times and a 10 minute min, 1 minute increment pricing model. Ironworker is interesting, but the potential delay for a standard job (15 min) along with the cost vs computing time it's hard to justify for my tasks over just renting a machine from OVH ($50/mo would pay for a decent 32G machine, so I could run a lot more than the 25/500 limit for the smallest tier) and the 1 hour limits on the smaller plans cause the same issues as with the 60s limits on lambda. I'm not knocking these services, they're all really impressive, just unfortunately have various restrictions / limitations that limit their application to the problems I currently have. If I had slightly different problems, I'd already be using one of these options. If people are using other services, I'd love to hear what you're using! Edit - offtopic, but every post I've made recently has gone through twice. Chrome 43.0.2357.124 on a mac here. Anyone else having the same problem?
- BillinghamJ 11y agoSeems like it would be good to take the file, then dump each line onto a queue, then have lambda run for each thing on that queue. It should parallelize really nicely.
- deleted 11y ago[deleted]
- alexatkeplar 11y agoOne of the larger painpoints with running Hadoop/Spark jobs on Elastic MapReduce is around classpath conflicts, so it would be great to get a page similar to [1], showing what's available on the Java classpath for AWS Lambda functions. [1] http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/ami-versions-supported.html http://docs.aws.amazon.com/ElasticMapReduce/latest/Developer...
- thescrewdriver 11y agoScala support for Lambda: https://news.ycombinator.com/item?id=9724933 https://news.ycombinator.com/item?id=9724933 https://aws.amazon.com/blogs/compute/writing-aws-lambda-functions-in-scala/ https://aws.amazon.com/blogs/compute/writing-aws-lambda-func...
- willcodeforfoo 11y agoIt'd be pretty neat if Lamba just let you run a Docker container.
- manishsharan 11y agoStripe devs -- if you are listening-- an example of using web hooks with AWS Lambda would be very helpful.