Reputation: 351
I have an application that will give SAS tokens to registered users to upload and download directly from Azure storage. What is the best way to monitor the bandwidth for each of my users?
I have taken a look at the logs that Azure provides, and looking at things, a possible way is to bind the SAS token to the user's ip address, and then check the logs for the <requester-ip-address>
field. However, this way doesn't seem so concrete as multiple users might have the same ip address.
Also, I see a <request-id-header>
field which, according to the documentation, is an opaque value that uniquely identifies the request. However I don't see any way of getting the header value if the user directly communicates with azure storage.
Thanks.
Upvotes: 3
Views: 1298
Reputation: 286
A different approach could be:
Upvotes: 1
Reputation: 24569
What is the best way to monitor the bandwidth for each of my users?
Based on my experience, we have no suitable way to do that. It seems that we couldn't get the bandwidth value. If you worry about the limition of azure storage, we could get the Azure Storage limitation from the azure official document.
Maximum Request Rate per storage account Blobs: 20,000 requests per second2 for blobs of any valid size (capped only by the account's ingress/egress limits)
Target throughput for single blob Up to 60 MB per second, or up to 500 requests per second
Update:
We could according Azure price calculator to adopt appropriate strategy to limit the cost for user.
Take General-purpose Storage Accounts for example, the cost depends on Storage transactions and Capacity. If we want to limit the cost for the user. On my opinion, we could limit the size*transaction for the user.
Create relationship for SAS tokens and user
Get the request uri
and request-content-length
from the log and we also count the request for user
Use logic to control the size*transaction for user.
About Storage Analytics Log Format please refer to azure document.
Other related link:
Understanding Windows Azure Storage Billing – Bandwidth, Transactions, and Capacity
Upvotes: 0