Chris Pietschmann
Chris Pietschmann

Reputation: 29905

How to view/report on Windows Azure CPU and Memory usage?

What's the easiest method of viewing and reporting on the CPU and Memory usage percentage statistics on all the server instances hosting an application on Windows Azure?

Is it necessary to write a Worker Role that monitors and logs the CPU and Memory usage? Or, is there something in Windows Azure that automatically logs this that you can just tap into? If something custom needs to be built, what is the best method to do so?

Upvotes: 7

Views: 8354

Answers (2)

codingoutloud
codingoutloud

Reputation: 2155

Sounds like a job for Windows Azure Diagnostics. The basic idea is (a) you enable diagnostics in your role code to govern the types of diagnostics you wish to gather, (b) this diagnostics data is collected on your behalf by an agent that runs on each deployed instance, and (c) the agents send each type of data to a defined location so that the data across all deployed instances is in the same place (which will be in Azure Blob Storage or Azure Tables Storage, whichever is a more natural fit, depending on the nature of the data).

General Documentation here, and specifics on Performance Counters (for memory and CPU) are here. General "how to" writeup on Neil's blog.

It is not necessary to write a special Worker Role for this, and no custom code required (other than the small boilerplate code to specify what it is you wish to gather logging about).

Upvotes: 6

knightpfhor
knightpfhor

Reputation: 9409

Yes there is built in functionality for logging out performance counters to table storage. There are plenty of articles out there which cover this, but this seems to be the jumping off point on MSDN.

The short overview is that you can set them up performance counters in code when your role starts or if you don't want diagnostics running all the time you can change your settings remotely. On a scheduled basis the logged performance counters get copied to the WADPerformanceCountersTable in the azure storage account you specified. From there you can query it yourself or you can use a commercial tool like Cerebrata Diagnostics Manager which will draw graphs for you like you're used to seeing in Windows (and lots of other things related to diagnostics in Azure)

Upvotes: 4

Related Questions