1 / 69

Complex Azure Functions

Complex Azure Functions. What is the biggest problem with AWS Lambda?. “Arc helps you share code between AWS functions”. This is not a problem in azure!. A little about me. 8 Years in the tech industry I work @ cargurus Mostly on web performance problems I <3 cloud!.

Download Presentation

Complex Azure Functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Complex Azure Functions

  2. What is the biggest problem with AWS Lambda?

  3. “Arc helps you share code between AWS functions”

  4. This is not a problem in azure!

  5. A little about me • 8 Years in the tech industry • I work @ cargurus • Mostly on web performance problems • I <3 cloud!

  6. What my mom thinks I do What I think I do What I actually do

  7. What are we going to talk about?

  8. Dream of the cloud • Pretend its 2008 again • “In the future the cloud is going to be awesome” • “You will only pay for what you use” • “Focus on just your apps, let msft/amazon/google manage the infra” • “Things will just magically scale” • Erhmagard Microsoft is taking our jerbs

  9. Reality of the cloud so far • Many “lift and shifts” cost more than co-locations • Applications need to be “Cloud Native” to see benefits • You do have to care about the infrastructure • App svc is “IIS as a service” • AKS is kubernetes as a service • Things do not magically scale, you have to configure them • Typically we’ve paid for compute units even if we’re not fully utilizing them

  10. Azure App Service • IIS as a service • You still have to care what modules are installed by default • You pay per instance • S1 -> 1 CPU 2GB ram • S2 -> 2 CPU 4GB ram • You are always under utilizing the hardware or over utilizing causing scaling

  11. Azure Scale sets • Basically VM’s as a service • Need to be hooked up to load balancers • Need to be managed with Configuration as a service

  12. AKS • You have to know how kubernetes works • Still need to configure autoscaling • Have to worry about cluster capacity

  13. What is azure functions? • “Functions as a service” • Azure’s serverless offering • Although serverless does not mean no servers • Functions trigger on an event • Write a function, azure will run and scale it • You pay only for the milliseconds you use • Billing info coming later ^_^ • Azure will scale these in a linear fashion • Play very well with Logic Apps!

  14. Functions support • Support any dotnet language (C#, F#, VB) • JavaScript • Java • Docker containers (non-consumption)

  15. Characteristics of functions • Ephemeral • Event driven • IO calls are Non-blocking • Stateless

  16. What is not good for functions • Functions that require a large in-memory cache • This can be mitigated with Memcached, redis or other distributed cache • Things that need persistent open connections • Websocket servers • IRC servers • SSH bastion hosts • Low latency concerns • Trading applications

  17. Gotchas with functions • “Double billing” • Make HttpClient static in C# • 300 bound sockets • 600 coming soon! • Large JavaScript functions can load slow • Webpack • Write defensively • Poison Queue messages

  18. Traditional infra Image Upload Return ok! Server process

  19. Serverless infra Image Upload Return token Finish Processing Done/Not Done Check Status

  20. Demo time!

  21. Durable functions • Stateful functions • Define workflows with other functions • Checkpoint workflows • Not billed on a consumption model!

  22. Durable functions Use cases • Complex workflow of functions • Functions that can pause and resume

  23. What are we going to talk about?

  24. Pricing • Consumption • Execution Time • Execution Units • Durable • Pre-pay (app service)

  25. Consumption model breakdown • Execution units • Number of executions • First 1 million free • Price per $0.20/per 1 Million • Execution time • Measured in GB seconds • 400,000 GB seconds free

  26. What is GB-s? • Observed resource consumption is calculated by multiplying average memory size in gigabytes by the time in milliseconds • Memory used by a function is measured by rounding up to the nearest 128 MB, up to the maximum memory size of 1,536 MB, with execution time calculated by rounding up to the nearest 1 ms. • The minimum execution time and memory for a single function execution is 100 ms and 128 mb respectively.

  27. Penny Pinching • Pay for your functions • Storage blob reads/writes • Egress bandwidth

  28. Penny pinching!

  29. Cloudflare • Content Distribution Network (CDN) • Cache responses from http requests • Cache images/scripts/etc. • Cache redirects • Cache-Control • max-age • expires • etag • Workers are like azure functions on the edge ($5/mo)

  30. Pwned Passwords • Type in a password • Tells you if that password is in a data leak • Completely serverless • Azure functions • Cloudflare • Azure Blob storage • K-Anonymity

  31. K-Anonymity • The first 5 characters of the password are hashed • The function receives the hash and return a text file of all of the hashes that start with that character • The browser then searches that file for the exact record • No transmission of passwords

  32. Why’s it matter • https://api.pwnedpasswords.com/range/E9354 • Function finds E9354.txt • Returns it • Cloudflare caches the file • Next time that hash will be cached!

  33. “If you can architect things the right way you can run things in a cost effective way”

  34. Infrastructure as code • Manually clicking in the portal isn’t enough • How do you mange thousands of functions? • What about bootstrapping non-prod environments?

  35. ARM • JSON document that defines infrastructure • Works with all resources in azure • Support variables • Dependency workflow

  36. Apply ARM Deploy function

More Related