Devops, Serverless, and Azure Durable Functions — Part 2 Costs

In my first post, I explained why to choose Azure and Azure Durable Functions. In this article, I will provide real-life cost and POC with supporting data. Remember costs change over time so to confirm the costs I’ll share the tools and method to run your own tests.

Create the Azure Function App

I set up a function app on Azure from the Azure portal. I used c# .net core and windows boxes because Linux is still in preview. No need to fight bugs from preview products.
Search for Function App in the marketplace
Setup your function app

Create a durable function

My Colleague Kevin Jones, created a quick durable function that is ready to deploy in Azure.

https://github.com/KevinDJones/DFDevOpsTest

It’s an HTTP event orchestrator that accepts a JSON object. The request payload is editable to change the length of execution time or delay the job processing. If you’re more interested in Azure functions in general, then see Kevin’s article.

Deploy your function

I hooked up a test CI/CD pipeline to make deployments and changes easier. You can see how it’s done in the next couple of articles. If you’re doing the cost analysis, connect Github and auto deploys your master branch. That works fine for POC’s and testing

Once deployed you should have these functions and we can run our load test.

Running the test

The test needed to mimic the following use cases and requirements:

  • Burstability — Automatically scale up and down
  • Error rate — increased load doesn’t increase errors
  • Response Time — is constant and predictable
  • Cost — was cheaper than running your own Kubernetes/docker cluster

To set up the test I used Blazemeter. There are many tools, this one happened to be an evaluation stage and easy to implement. The test configuration included 1 engine, 1000 threads for a 5 min period. I ran the test a few times ending in ~450k requests.

Load Test configuration
Performance results

You can see from the load test that we had a solid performance with a steady increase of response time. It’s worth noting that response time is slower than typical web apps. If you need faster response times you may need to do some further tuning or run separate tests.

Results were:

  • Function Executions = 500k
  • Function Exec time = 17894.1 gbs
  • Total costs $.085 (remove azure devops from image below)
Cost Results

I was not charged for idle time and only for storage resources. Since Azure gives you a free tier we never hit costs for the function apps. Go to azure pricing page and compare the executions against the sheet to determine what your load might look like.

Serverless is cost effective!!

This model is great for burstable loads or event based process’s. The cost is much cheaper than a Kubernetes, Docker or VM implementation

Docker/Kubernetes is still built on the foundation of pre-allocated resources. In comparison, a stack similar to this you need at least 6 vms.

  • Two for application high availability
  • Two for data persistence and high availability
  • Two to replicate across regions

If these vm’s were even $50 a piece you would be spending 300 for the vm’s plus storage. With Azure Durable Functions we paid $.085 and really just for the storage.

How does Azure make money if it’s so cheap!

Make development easy, cheap and business effective and charge for the plumbing. Database’s, messaging bus, region availability are all areas Azure provides great value. It’s plumbing you’re business doesn’t want you to focus towards (unless you work for a DaaS company or azure competitor). Azure is utilizing it’s idle resources to give you a good way to get business going. In return, you’ll use the savings to buy infinitely scalable database’s like cosmosdb. And I suggest you do.