Skip to main content

TechDays 2011: Some great Windows Azure tips

Last week I attended TechDays Belgium. During two sessions about Windows Azure, Christian Weyer gave a lot of interesting tips.

AzureWatch

The first thing he mentioned was a tool called AzureWatch. This tool enables the automatic scaling functionality that is not available out-of-the box. It monitors your performance counters, instance statuses, queue information and other metrics and passes all this information to some rule engines that can take decisions based on this input. 

Most important features are:

    • Automatically scale-up or scale-down your Azure instances based on...
      • Real-time demand using latest values of performance counters
      • Historical demand based on aggregated values of performance counters
      • Rate of increase of decrease in demand
      • Time of day
      • Sizes of Azure queues
      • Instance Ready/Unresponsive/etc statuses
      • Any or all of the above combined
    • Receive email alerts when user-defined conditions are met, such as...
      • When instances become unresponsive
      • When quantity of instances reaches maximum threshold but your system is still under heavy load
      • At predefined intervals with up-to-date performance metrics
    • Gain visibility into performance of your Azure applications with...
      • Powerful and comprehensive dashboard
      • Single Perfmon that displays performance metrics of your application averaged across all Azure instances
      • Analyze, print, or export performance metrics dating up to a month back
      • Drill-down reports and charts showing key performance indicators on a monthly, daily, or captured level
    • Safety mechanisms
      • Built-in limits prevent your instance count from going outside of a predefined range
      • Built-in throttle controls prevent your applications to not scale up or down too frequently

Deployment in 3 seconds

Another thing he showed us was a way to easily deploy Windows Azure applications without having to go through the entire deployment process of Windows Azure(which takes time).

The idea is the following:

  • use Windows Azure Blog Storage to host the website/webservice package
  • use a 3rd party tool to map the blob storage account as a folder in Windows Explorer
  • Build the application, zip the output and copy the zip file to this folder
  • On your webrole add some code that checks for new files in this blob storage location. If new files are found extract the package and deploy it in IIS on the web role.

This idea takes advantage of the fact that starting from SDK 1.3 the web app and the roleentrypoint code run in their own process(Christian called this the ‘web-workerrole’ functionality).

If you are looking for a tool to mount your storage accounts locally in Windows Explorer,he recommends Gladinet Cloud Desktop.

During his talk he gave a demo where he was able to deploy a website in a few seconds.

For more information about this, check out Christian’s blog.

Azure versioning

At the moment there are 2 families of the Azure OS available:

If you create a new instance, by default it’s configured to use version 1. Christian recommends to always upgrade this to version 2 and don’t specify a specific version(by doing this your system will be upgraded automatically).

<ServiceConfiguration osVersion="*" osFamily="2" serviceName="CloudService1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Role name="WebRole1" >
<Instances count="1" />
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
<Role name="WorkerRole1">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>

More information about this here.



Thanks Christian for all these tips!

Popular posts from this blog

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...

Cache stampede: when our cache turned against us

While investigating some performance issues, we ran into an ASP.NET Core API that cached a fairly expensive aggregation query for 60 seconds. Under normal load, that was fine: one request rebuilds the cache, everyone else reads from it. Under peak load, dozens of requests would arrive in that same expiry window, all see a cache miss, and all fire the same expensive query in parallel. The database didn't like that. That was the moment when our caching layer stopped helping and started hurting. A burst of requests comes in at the same time, all miss the cache, and all go hammer the database or the downstream API at once. That's a cache stampede . The cache was supposed to protect our backend, and for a few hundred milliseconds it did the opposite. Why this happens IMemoryCache.GetOrCreate (and its async sibling) looks like it protects you, but it doesn't add any locking on its own. Look at the naive version: public async Task<Report> GetReportAsync(string key) ...

A complex system designed from scratch never works

A few years ago, I worked as an architect on a big mainframe rewrite. I still count it as one of my failures. Not because the technology was wrong, but because I couldn't convince the management team to simplify the approach. Years later, the organization is still struggling to get the new system up and running. I left the project at the time, because I couldn't put my name behind an approach that would take very long and cost a lot of money without a working system to show for it along the way. Gall’s Law That memory keeps coming back to me, because it's a textbook case of Gall's Law playing out in real life. Gall's Law , from John Gall's Systemantics , states it plainly: A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works, and it cannot be patched to make it work. You have to start over with a simple system that works. What does that mean in practice,...