High cost on Azure Function webjobs storage for Event Hub checkpoints

Viewed 820

We want to use an Azure Function (AF) to pull data (15k msg/min & 35 Mb/min) from an Event Hub (EH) and store it in Azure Synapse (formerly Data Warehouse). For EH input, the AF uses a Storage Account to store the most recent checkpoints of every EH partition (32 partitions). For some reason the cost of this storage is by far exceeding the cost of the AF itself.

The cost analysis by meter for one day shows, that it´s the high count of read, write & other operations, which cause these high costs. Also you can see, that the storage costs are around 40x higher than the Function itself.

The interesting thing is we already successfully use a similar setup with an EH being input for an AF, where the storage costs are roughly the same than the AF itself, despite the EH streaming the same data (messages & volume) and also being configured with 32 partitions.

This stack overflow question seemed to deal with the same issue, but there was no real solution apart from,

"I believe creating a new function and deploying the code to that has fixed the problem."

What are we missing? Thx

1 Answers

We had the same issue.

  • Use General Purpose V1 storage accounts instead of V2 or blob storage. For one client, we got the storage account costs down from about 3000€ per month to about 100€, just by using V1.
  • Do less checkpointing. Don't checkpoint after every single message. You can control that by increasing the setting batchCheckpointFrequency for EventHub triggers. The only downside is that you might reprocess a couple of messages in case your function goes down unexpectedly.
Related