Azure Storage Table size
Asked Answered
S

3

14

Azure billing is based on the size of used space. Now I need to know the details. What is the size of each storage object in my storage (blob container, single table)?

It's easy to write a code that enumerates all blobs and calculates the overall size per container. But what about tables? How can I get the size of a certain table in Azure storage?

Sisterinlaw answered 30/11, 2012 at 9:0 Comment(0)
L
7

If you're not interested in getting a breakup by blob container, you don't have to write the code as far as finding the blob storage size is concerned. This information is available to you via storage analytics (http://msdn.microsoft.com/en-us/library/windowsazure/hh343270.aspx). The table of interest to you would be $MetricsCapacityBlob (http://msdn.microsoft.com/en-us/library/windowsazure/hh343264.aspx).

Coming to tables, unfortunately no such thing is available and you would need to fetch all entities and calculate the size of each entity to find the table size. You may find this blog post useful in calculating the size of an entity: http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/30/how-the-size-of-an-entity-is-caclulated-in-windows-azure-table-storage.aspx.

HTH.

Lustihood answered 30/11, 2012 at 11:37 Comment(2)
If a rough estimate is enough for table size, you could 1) query for a single row, 2) calculate the size of the row given the data above (assuming most rows are similar in size), 3) query all rows for a single column (say, Timestamp) to get a count of rows, 4) multiply results from 2) and 3). Again, this is a rough estimate but at least it doesn't require retrieving all data from the table.Empathy
The blog URL is a dead link. Please don't link to URLs, but instead post the relevant information in your answer.Mont
U
3

There is a tool which can get table size or entities count for you. Azure Storage Manager

  1. Select a storage table in left tree pane
  2. Click 'Property' button
  3. Click 'Calc' button on the table properties dialog
  4. Wait a few moment, till 'Calc' button becomes available again.
Uranium answered 15/2, 2016 at 5:52 Comment(1)
Looks like the link is to an old CodePlex archive -- which will be deleted on 7/1/2021. -- I uploaded a copy of the zipped binaries to archive.org/details/AzureStorageMgr -- (There was no source code, just a text file that said "Hello" where there should have been, so that's why I only uploaded the binaries.) -- FYI though, it doesn't appear to work with V2 storage accounts. ☹Mont
M
3

Here's the Step by Step of how to get this info:

  1. Go into "Monitor" in Azure (it's a top level item on the left nav by default), it looks like a speedometer, or perhaps a really fast one handed clock.

  2. Then select Metrics (it's below Alerts, and above Logs, in the first grouping).

  3. Then from the "Select a scope" pop-up, select your storage account and pressed "Apply".

  4. Then on the empty table there are some drop downs, the first one will have the scope you applied. The second one, Metric Namespace, should be "Table", the third one, Metric, should be "Table Capacity", you can leave the last one as Avg -- if you only have one table in your storage account then the Avg will just be the exact size of that table.

  5. If you want to calculate the average row size, you can do a simple divide -- in my case I did 1.4 GB / 2.5M entities = ~560 bytes

enter image description here

Mont answered 12/2, 2021 at 3:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.