9 ms·
Microsoft Azure: Functions
- aaronbrethorst 11y agoI'd love to use Lambda, but the cold start issue[1] makes it a nonstarter for me. Anyone know if Azure Functions works around/solves this problem? [1] documented here, e.g. https://forums.aws.amazon.com/thread.jspa?threadID=181348 https://forums.aws.amazon.com/thread.jspa?threadID=181348
- crandycodes 11y agoAzure Functions PM here. We have some cold start behavior as well, but we generally only see it for the first request. You can also enable always on, which keeps the host hot, but that disables serverless billing.
- turtle4 11y agoCan you elaborate on this at all? First hit within what type of time frame?
- crandycodes 11y agoWe don't yet have a committed time we'll keep you warm and it might change (<-- this is me hedges against future change :)), but it's about 5 minutes today. That's ANY function within a collection of functions running.
- aaronbrethorst 11y agoCan you offer any sort of guidance on what cold start times currently look like? I know it depends on how much code is being loaded and interpreted, but it's obvious you're a really dedicated PM, and I know that—as a result—you must have a qualitative sense of what the perf looks like. For background: I maintain OneBusAway for iOS, and am investigating options for sidecar data (e.g. how delayed is a bus, is there still room on it, etc.). Ideally, this would all be part of the core OBA API, but that may not be an option. I'd just use Apple's CloudKit, but I want to be able to process incoming data and share the data between iOS and Android. Hence my interest in your product :)
- crandycodes 11y agoI just ran a sample http triggered function after it sat around cold. It took about a second to respond with "hello world" and then under 100ms after that. Purely anecdotal. Your experience will vary, etc. Cold start is kinda par for the course with "serverless" so far. We're trying our best to minimize the time it takes to having NO servers to having a server. I think we've got some great folks on our team working to solve that. FYI - You can reserve a VM, if you want, but then you're paying until you turn it off. It will always stay hot, though.
- aaronbrethorst 11y agothanks!
- narrowrail 11y agoI have to admit that I don't get it either for most of these offerings (as mentioned elsewhere, there are offering from all the big tech giants incl. IBM). However, it seems to me that one could just use a $10/mo Linode that is always running and predictably costs $120/yr. There could be data transfer costs into/out of these cloud services that make Lambda-like offerings more competitive from a TCO perspective, but that seems unlikely and project specific. I would like to hear a valid use-case from an actual user. Edit: typos/ punctuation
- IanCal 11y agoI can run a $10/mo linode box, but then I need to deal with 1. Scaling up 2. Scaling down 3. Actually managing the box itself If what you're making is compute focused, then this kind of thing is a godsend. I want to write code to do some processing and have a team of magic elves handle all the hardware related stuff. The other advantage is that I can price things really easily. One call == 23s processing time on average. How much do 100 users making an average of 100 calls each day cost me? Running my own boxes means I need to consider reasonable waiting times, peak usage, speed of scaling, etc. With something like this/lambda/google's version I just go cost_per_second multiplied by 23 multiplied by 10,000.
- RussianCow 11y agoNot an actual user, but I know people who have used Lambda with success. I think the main use case is APIs for which traffic is extremely variable. It's less about cost and more about the ability to seamlessly scale up with traffic. For instance, if your site gets featured on Hacker News, services like Lambda and S3 allow your site to scale almost infinitely and handle all that traffic with ease, and yet they're super cheap when you don't get much traffic, so in those cases you get the best of both worlds. The equivalent using a traditional VPS is either to have a really beefy machine running 24/7 (expensive), or to build an architecture that allows you to spin up more instances at will and scale that way (really time-consuming and difficult to get right).
- ddorian43 11y agoI think you need a cdn to scale s3. So probably s3 is not enough. The equivalent if your api is mostly for reading is to put varnish in front of it.
- crandycodes 11y agoI'm Chris from the Azure Functions team. Feel free to AMA.
- fha 11y agoWhy is Microsoft being so awesome today?
- UK-AL 11y agoToday specifically? It's Microsoft build conference. It's when they release all their stuff.
- Bootvis 11y agoTrue, but I can't remember whatever they released last year ;)
- crandycodes 11y agoUK-AL is right, today is the day to be awesome. My personal answer is that the people working at Microsoft are awesome. We built this product in less than 90 days based on existing platforms; we were given the freedom and resources to do that. Awesome things are going to happen when we have that kind of environment.
- crandycodes 11y agoI got asked a lot of questions about how we're built today and so I'm adding this comment for historical purposes. We're built around WebJobs SDK and App Service, so much of the core work was done already and I had a plan in the works for a few months to bring Node support (I'm a Node.js nerd) to WebJobs. WebJobs has been and is increasingly popular, so it was a no brainer for our team to go and expand and promote it. It was still a lot of work to deliver a WebJobsSDK-as-a-service, but we knew we had a solid core and a great PaaS platform before we even got started.
- msoad 11y ago
- dethswatch 11y ago"HEY! We can do AWS Lambda too! Please use us... we're lonely."
- nailer 11y ago> Azure Functions allows developers to take action by connecting to data sources Could I connect to a database on a socket, or is this for 'pure' functions without side effects?
- hardwaresofton 11y agoFrom their page (https://azure.microsoft.com/en-us/documentation/articles/functions-overview/ https://azure.microsoft.com/en-us/documentation/articles/fun...): > Write any function under a minute - either when you need a simple job to cleanse a database or to build functionality that processes millions of messages from connected devices. Use your development language of choice (C#, Node.JS, Python and more). Pay only for the time your code runs and trust Azure to scale as needed. Sounds like you'll be able to connect to other stuff. IMO functions without side-effects are useless in many contexts, I'd guess that this is one of them, as you probably want to use the results of your computation somehow.
- crandycodes 11y agoYup. You are sandboxed for certain activities, but you can certainly create outbound requests for talking to databases or APIs
- curiousDog 11y agoSurprised they didn't call it Delegates, haha.
- hyperliner 11y agoMore surprised they did not call it "Lambda for Azure, Cloud Edition"!
- gagege 11y agoF#, Microsoft's FUNCTIONAL programming language, can not be used to write Azure FUNCTIONS? You can even see them borrowing from F# with the .csx files for writing C# functions. I'm a constantly dumbfounded at the way Microsoft neglects this wonderful language.
- crandycodes 11y agoWe had to make some tough scoping calls, but we are actively working on full F# support, based on our C# implementation. You can use F#, but right now it is pretty basic. Check out this sample which you can also deploy via the portal (experimental category): https://github.com/Azure/azure-webjobs-sdk-templates/tree/master/Templates/QueueTrigger-FSharp https://github.com/Azure/azure-webjobs-sdk-templates/tree/ma... Thanks for the feedback!
- gagege 11y agoGreat news! Thank you.
- paulbatum 11y agoSlight correction, F# support is broken right now. But its being fixed as we speak :) https://github.com/Azure/azure-webjobs-sdk-script/pull/203 https://github.com/Azure/azure-webjobs-sdk-script/pull/203
- paulbatum 11y agoIgnore my earlier comment, we pushed out some fixes. There is a working F# template in the experimental category. However please note that the performance is not great right now, you'll pay a startup cost of invoke fsi.exe per function invocation. It will get better!
- crandycodes 11y agoI mentioned this in the other thread (https://news.ycombinator.com/item?id=11398402 https://news.ycombinator.com/item?id=11398402), I'm Chris from the Azure Functions team. Feel free to AMA. :)
- gagege 11y agoLooks nice, and if I ever have a need for something like this I'll use it over Lambda, because of C#. But, why no F#? Seems like an obvious language to support.
- crandycodes 11y agoI replied to you below. Mostly it's a time thing. We built this thing in under 90 days. We should have support for F# soon, based on our C# implementation. We're using a pipeline for C# which we think F# should just drop into. (You can see our C# implementation here: https://github.com/Azure/azure-webjobs-sdk-script/blob/master/src/WebJobs.Script/Description/CSharp/CSharpFunctionInvoker.cs#L414 https://github.com/Azure/azure-webjobs-sdk-script/blob/maste...)
- gagege 11y agoThat makes sense. Thank you so much!
- lindydonna 11y agoIn fact, Don Syme and the F# team are working with us to get this done more quickly. @VisualFSharp on Twitter can tell you more.
- crb002 11y agoHow about shelling out to native C/C++? I have Haskell running on AWS Lambda would be nice for Azure Functions, https://github.com/chadbrewbaker/introToAWSLambda https://github.com/chadbrewbaker/introToAWSLambda
- devy 11y agoGoogle Cloud Platform (GCP) had released similar offering in alpha called "Google Cloud Functions"[1] two months ago[2] as well. [1] https://cloud.google.com/functions/docs https://cloud.google.com/functions/docs [2] https://news.ycombinator.com/item?id=11066718 https://news.ycombinator.com/item?id=11066718
- psuter 11y ago...and IBM announced OpenWhisk in February (and it's open source!): https://developer.ibm.com/openwhisk/ https://developer.ibm.com/openwhisk/
- sciurus 11y agoSee https://news.ycombinator.com/item?id=11398323 https://news.ycombinator.com/item?id=11398323
- dang 11y agoWe merged them.
- base 11y agoVery interesting. Seems a lot easier to setup than in AWS (Lambda + API gateway). Now you just need support for more languages like Ruby :)
- swalsh 11y ago2 questions. Does this work with Service Bus? Right now I have a console app sitting on a linux VM (written in C#) that connects to Service Bus, waits for messages, and handles it. A lot of what I do in my app is write file to the local system, and upload it via FTP to somewhere else. Now, there's no requirement to write the file to anywhere locally (i do it more as a backup, and I could back it up in a database table i suppose), but its super convenient... how does the file system work in a system like this? Would it require Azure Storage?
- crandycodes 11y ago1. We should have Service Bus support in the next month or so. You can see a sample of it in progress here: https://github.com/Azure/azure-webjobs-sdk-script/tree/master/sample/ServiceBusQueueTrigger https://github.com/Azure/azure-webjobs-sdk-script/tree/maste... 2. You can access the file system and all your functions share the same files because we're using a network file share.
- swalsh 11y agoVery cool, definitely going to use it the next time I get a moment to clean up some tech debt.
- Delphiza 11y agoAnd event hubs? Based on https://github.com/Azure/azure-webjobs-sdk-script/tree/master/sample/EventHubTrigger https://github.com/Azure/azure-webjobs-sdk-script/tree/maste... I assume it's also coming soon?
- paulbatum 11y agoEvent Hubs support is already in there and we have a couple of basic templates. Make a new function and check the "Data Processing" scenario category.
- crandycodes 11y ago
- eb0la 11y agoGood timing. I was about to reccomend starting a project on AWS because Azure didn't have something like aws lambda. Great job guys
- luisrudge 11y agois there a separate runtime that I can install locally (or in another cloud)?
- crandycodes 11y agoIt's possible today and we'll make it easier over the next two months. https://github.com/Azure/azure-webjobs-sdk-script/wiki https://github.com/Azure/azure-webjobs-sdk-script/wiki
- codesapien 11y agoAnd to clarify, this is not a separate runtime. These are the actual bits we run in Azure. It's all open! :) As mentioned, we'll be working to enhance the local dev scenarios over the next coming months, which goes beyond just being able to run functions locally.
- IanCal 11y agoLooks really interesting, I've been waiting for on-demand python since picloud shut down. Is there any information on pricing? Links in various places say to visit the pricing page but the pricing page just says what's free and how it's billed with no actual prices. What are the limitations? I assume there's some limit to the size of what I upload (data/code/dependencies). Is there a maximum runtime? Edit - Given this is in the early stages, I'd love to request a manageable runtime limit. I understand why you don't want to have people complaining that they started 10k infinite loops, but I'd like to be able to limit things to either short periods for things I know really should complete in < 10s or longer ones as I've got a bunch of stuff that might take 10 minutes or more I'd also like to do. This might be an issue on your side though, I can see it being an issue starting 10k long running requests rather than knowing you just need to schedule 10k 1 minute requests.
- crandycodes 11y agoOur pricing is either the dedicate App Service pricing which is GA'd already or the new Dynamic tier which is FREE (as in beer) until beginning of May. We'll have pricing come out sometime this month. You should have at least a GB of disk space to work with. We don't have a maximum runtime, yet, but we're likely add a "timeout" feature in the near future so you can optionally time it out.
- IanCal 11y agoThanks for the reply. > Our pricing is either the dedicate App Service pricing which is GA'd already or the new Dynamic tier which is FREE (as in beer) until beginning of May. We'll have pricing come out sometime this month. Sounds good, I'll keep an eye out for it. After seeing somewhere else in the thread that this took you < 3 months I would have been very surprised if you'd also settled on pricing already! > You should have at least a GB of disk space to work with. That's fantastic, a huge step up from lambda. > We don't have a maximum runtime, yet, but we're likely add a "timeout" feature in the near future so you can optionally time it out. Very nice. These two bits of information make functions useful for far more tasks, thank you!
- adopo 11y agoCan you give some pros and cons of using Azure Functions vs Azure Service Fabric? What are some of the reasons you would use Azure Service Fabric over Azure Functions?
- itaysk 11y agoThose are completely unrelated products. Functions is a server-less philosophy kind of thing. SF is a cluster management and orchestration technology so obviously very server oriented (It manages servers)
- adopo 11y agoWhen you look at stateless Microservices vs azure functions which you run all the time in app service, they both appear to overlap. My question was more focused here
- crandycodes 11y agoSo Functions could be treated as an opinionated, lightweight microservice framework, and thus you could compare it to other microservice frameworks like Service Fabric. Service Fabric is great for so many reasons. It can handle large, heavy duty applications. Functions is great for the opposite reasons, small & lightweight. You should be writing Functions like you'd write a unix tool; it should to one thing and do it well. Cory is in the middle of a great talk where he helps "demystify" these services. (Which I can't find a link to right now...)
- deleted 11y ago[deleted]
- andrewstuart 11y agoA more distinctive name would have made it easier to search for. Hopefully everyone who ever writes anything on the Internet about this refers to it as "Azure functions", which will make it possible to find information. This seems unlikely however. Microsoft would have helped out everyone-with-a-question by giving it a slightly more distinctive name to search by, such as PureFunctions or something. Search Bing for: "problem with functions" "functions won't initialize" "how to write functions with functions" "what sort of language can I use functions with" "getting started with functions" "error with functions" "how to write lambda functions with functions" "my functions function is not functioning" The pain begins instantly.
- crandycodes 11y agoThe time I spent in meeting discussing this name... :) Honestly, you're right that we're going to run into fun search engine issues, but Stack Overflow tags should hopefully help. We opted for making it obvious what our product was doing and Functions was an logical evolution of our WebJobs SDK Functions concept, which is essentially what our product is - this is just a WebJobs SDK-as-a-Service. Time will tell; I hope we don't have to rebrand someday just to show up in the search engines, but we'll do what we hope is best for the customer.
- andrewstuart 11y agoYou just said "yes its the wrong name, but we are doing it anyway and hoping StackOverflow will fix it or compensate for the wrong decision that we have made but are unwilling to fix because the politics was already so stressful that we don't want to go back there and besides a more important Microsoft manager than me made the decision, so it can't be changed.". Don't underestimate the critical importance of being able to effectively search to resolve problems with any given technology. Programming is the process of using Google to find why some thing isn't working as expected, interspersed with writing the occasional line or three of code. Your product name "functions" breaks this process. You know already its a problem you should fix it now and consider it not a software bug but a branding bug - the beta program has revealed the defect, how you should fix it early before polluting the search engine space with this ill considered product name. You guys.... so corporate. It's like a Dilbert cartoon.
- nivertech 11y ago@crandycodes I have two questions: 1. How does Windows sandboxing implemented in WebJobs? 2. Do I understand correctly that all functions of the same Azure a/c may run in the same sandbox. I.e. you only sandbox users, but not individual Functions?