Azure Service Bus - estimation of the number of brokered connection - azure

I was trying to estimate no. of brokered connections while arrive at pricing for Service Bus (STANDARD TIER) for the following scenario:
There are 32 clients sending messages to/ receiving messages from a Service Bus queue through AMQP protocol.
Each client connects to the Service Bus several times in an hour, with duration of a single connection (including timeout) ~= 1 minute.
I understand from documentation that Microsoft charges based on the peak number of concurrent brokered connections:
Microsoft charges for the peak number of concurrent brokered
connections that exceed the included quantity (1,000 in the standard
and premium tier).
Now for one month, what will be the no. of brokered connections?
is it 32? - as, at any given point of time, there are only 32 peak live connections and based on the formula given in Pricing document. Therefore total connections being 32 connections * 24 hours per day * 30.5 days / 730 = 32.
or is it 1920? - as, in an hour, each client connects to Service Bus 60 times (no. of minutes in an hour [=60] / duration of a single connection [=1]). Therefore, total connections being (32 * 60) connections * 24 hours per day * 30,5 days / 730 = 1920.
Please help me understand how to calculate the no. of brokered connections in this scenario!

In this case, it will be 32 since there is hourly metering on Service Bus. (Even if it was per minute metering, it would still be 32).
Hope this helps.

Related

Azure Batch Pricing for scaling up and down within an hour

What is the pricing model when autoscaling an Azure Batch cluster up and down within the same hour?
For instance if a vm costs $x per hour and I scale my cluster up to 10 vms, then down to 0, then up to 12 within 1 hour, how many vms do I get charged for?
To my understanding of Azure VM pricing, pricing is listed by the hour, but billing occurs by the minute - rounded down, so 52:43 of usage would be billed as 52 minutes, so your cost for that machine would be:
VM hourly cost * number of VMs for a given period * number of minutes used in that period / 60
In your case, you scale up to 10 VMs, you need to establish how long you're at that level. Then, how long are you at 12 VMs? Apply the formula above each time and add.

Azure APIM Premium - Number of requests can handle

We are building an Ecom app which will relay on Azure APIM, we expect 66.5 million requests per day. In a pick hours, it would be 10 million requests. Can Azure APIM Premium handle such a load? At present we have 8 scale units, is that sufficient?
According to the docs the estimated maximum throughput is 4000 rps. If you have 8 scale units the estimated maximum throughput is
32.000 rps
1.9m rpm
115.2 rph
You can have up to 12 scale units so you should be safe to handle such a load. (You can call to have > 12 scale units if needed)

Ambiguity on how service bus/ event hubs charge on AMQP/Https connection

Currently we are trying to determine which message service we should use - service bus or event hubs. And then we found that there are ambiguities on the pricing so hope we could get answer here.
Service bus charge
https://azure.microsoft.com/en-us/pricing/details/service-bus/
in this link above we see that standard tier service bus charges on broker connection. and it measures per hour with the peak of the concurrent connections. So problem is this ,say if I have 5K client, but they don't keep the connection alive, say they they send the message once per minute and only open/close the connection at that time, then the peak of concurrent connections might even lower than 100. In this case, how would connections be calculated. Is it going to be calculated in accumulative way or as the peak of certain time in this hour.
in FAQ "What is a brokered connection and how do I get charged for them?" mentioned that "An HTTP call to receive a message from a Service Bus topic or queue that has a receive timeout value greater than zero.", so what about using HTTP call to send message, how it would be count?
And for HTTP call limitation. We could find that there is 5K AMQP connection limit, but what about HTTP? Is it the net messaging refer to? https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quotas .
Event Hubs charge
https://azure.microsoft.com/en-us/pricing/details/event-hubs/
In this link above we did not see how it charges on connection, but in FAQ it is saying the charge on connection, free on HTTP while AMQP charge is the same is service bus. So here comes two questions,
Is this charge tier matching? Charge on standard tier of event hub on connection is same as standard tier service bus and premium event hubs same as premium service bus? Asking because premium service bus does not charge on connection.
2 For HTTP messaging, same question as in service bus, how many concurrent http connection event hub could support concurrently?
Service Bus Charge
As the FAQ What is a brokered connection and how do I get charged for them? depicts, you will get charged by the hour and prorated for 730 hours in the month.
If all your clients connect to send messages per minute continuously, the charge would be
5000 * 24 * 30.5 / 730 = 5013
Since 1K connections are included, you would be charged for the remaining 4013 connections.
In this case, this call would just count towards a messaging operation.
As mentioned in the docs, REST operations don't count. You could however hit the concurrent receive requests limit.
Event Hubs Charge
Yes
Same as above. No concurrent limit.

Trigger Azure Function from Service Bus topic without consuming Brokered Connections

So, I'm analyzing whether using Functions to consume Service bus messages from a topic is viable.
The Service Bus pricing plan we chose has a limit on the number of 'Brokered connections' (max 1000) per month.
My understanding is that in the typical usage scenario the consumer/listener/subscriber connects to a topic and stays connected persistently, receiving multiple messages during a long period of time (a day, even a week) without breaking the connection, and that this is counted as 1 'brokered connection'. In the end you can receive thousands of messages on a single brokered connection.
How does this work with an Azure function binding? From what I read in the documentation, a function can be idle (ie not running), so it wouldnt be able to maintain this persistent connection.
Is there a separate component for Functions that keeps this connection alive listening for incoming messages? Or are we going to get billed for a new brokered connection each time the function goes idle and then restarts?
I'm including a screenshot of the current plan features:
https://azure.microsoft.com/en-us/pricing/details/service-bus/
Later in the same link:
edit
From Docs:
Service Bus charges for the peak number of concurrent brokered connections that exceed the included quantity (1,000 in the Standard tier). Peaks are measured on an hourly basis, prorated by dividing by 744 hours in a month, and added up over the monthly billing period. The included quantity (1,000 brokered connections per month) is applied at the end of the billing period against the sum of the prorated hourly peaks.
They specifically mention "1,000 brokered connections per month" in the last sentence.
This is an example:
Each of 10,000 devices connects via a single AMQP connection, and receives commands from a Service Bus topic. The devices send telemetry events to an Event Hub. If all devices connect for 12 hours each day, the following connection charges apply (in addition to any other Service Bus topic charges): 10,000 connections * 12 hours * 31 days / 744 = 5,000 brokered connections. After the monthly allowance of 1,000 brokered connections, you would be charged for 4,000 brokered connections, at the rate of $0.03 per brokered connection, for a total of $120.
So I guess all of this is for 10.000 subscribers connecting to the topic at the same time during 12hs, if they connected for 24hs each day then 9,000 brokered connections would be billed (10,000 minus the included 1,000)?
In any case, I'm also trying to validate whether persistent connections are possible with functions (I'm told they are with webjobs).
Azure Functions has a separate component known as the ScaleController that monitors your Service Bus for events 24/7.
Since the underlying SB message receiver in Functions is implemented in WebJobs, there will be a single connection that can retrieve multiple messages throughout the lifetime of the Function instance, although due of its current limitation, it is passing along those messages one at a time to your Function code for processing.
You are only charged when your Function code actually runs. Here's a link that gives you an overview of the ScaleController:https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#runtime-scaling
If you are anticipating relatively high load, have you considered using Event Hub instead of Service Bus? ServiceBus-Triggers in Azure Functions currently can only process one message at a time, which is not optimal for high load scenarios. Here's a GitHub issue that is opened to track this feature request: https://github.com/Azure/azure-webjobs-sdk/issues/1024
EventHub-Triggers can process messages in batches and that should give your more bang for the buck per Function execution. See https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs

Azure Notification Hub Billing

I have a question about Azure Notification Hub Billing (Prices here)
If I send a 1 message that fans out to (say) 10 client devices is that billed as 1 message or 10?
This kind of implies that that it would be 10 but it's a little unclear
Pushes include all notifications delivered to the platform
notification services (e.g. Windows Notification Service, Apple Push
Notification Service, Google Cloud Messaging, Microsoft Push
Notification Service). Push allowance is prorated and capped on a
daily basis.
(Hope this is an ok place to ask this, there are a few Azure billing questions and none seem to have been closed so I'm assuming this is accepted)
You would pay a flat fee of $22 (USD) per Unit for that example.
You are charged per "unit" where a unit on "Basic" (for example) includes:
unlimited device registrations
up to 500,000 pushes per month (or 16,667 per day)
If you publish 1 message that fans out to 10 devices you have generated 10 pushes. If you did not exceed the 16,667 messages in a day you'd pay $22 for a single unit.
If you need more than that you would need to scale the number of units (maximum of 9 for Basic / unlimited for Standard) to allow you to meet your demand.
Easiest way to perceive this is by considering total devices that have been reached out to using Notifications Hub; irrespective of the platforms being pushed on.
Example: 5-Android, 2-Windows, 1-iOS = 8 pushes!

Resources