ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Fiddler add duration column 

Categories: WebApi

Rules -> Customize Rules -> Edit CustomRules.js

public static BindUIColumn("Duration")
function CalcTimingCol(oS: Session){
var sResult = String.Empty;
if ((oS.Timers.ServerDoneResponse > oS.Timers.ClientDoneRequest))
{
var ts: System.TimeSpan = null;
var dtStart: DateTime = oS.Timers.ClientDoneRequest;
var dtEnd: DateTime = oS.Timers.ServerDoneResponse;
ts = dtEnd - dtStart;
if (ts.TotalMilliseconds > 2000)
{
oS["ui-color"]="brown";
oS["ui-italic"]="true";
}
sResult = ts.ToString();
}
return sResult;
}

WASABi Elastic Azure Scaling 

Categories: Azure Notes

Notes on Azure Elastic Scaling by Zoiner Tejada. This is again one of these PluralSight courses, where only the sample project is worth the membership to the site. Get it there. Check also: Channel 9 Autoscaling in Windows Azure 2013

Dodging the 503 server busy response

Scale for performance, capacity & availability
vs
Costs of over-allocating (Ideally paying for exactly what is needed)

Scale out/in: adding/removing number of instances

Scale up/down: increasing/decreasing the power of resources

Database can be scaled out by sharding with federations

Elastic Scale: The ability to adjust resources according to demand.

Scaling vs Throttling

Things needed to allow automating scaling

  • Build tooling to monitor cloud service's key performance
  • Use the Windows Azure Service Management API from your code
  • Collect diagnostics
  • Maximize clock hour use in scaling decisions
  • Send admins notification
  • Manage cool down periods between scaling actions

WASABi

WASABi diagram of components

Autoscaler

  • Metronome: collects kpi data
  • Scaler + Stabilizer: manage scale and notifications
  • Tracker: log outcome of actions

Using WASABi

  1. Add reference to WASABI library from your project 
  2. Nuget: Autoscaling Application BLock
  3. Instantiate Autoscaler in code : var autoscaler = EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>(); autoscaler.Start();
  4. Configure App, Service Information Store and Rules Store
  5. Deploy and run

Rule Evaluation
Contstraint rules over Reactive rules
Rule with highest integer rank wins
Intelligent scaling action on tie breaking

ServiceInfo.xml
Scale and/or notifications
Stabilizer ScaleUpOnlyInFirstMinutesOfHour
Stabilizer ScaleDownOnlyInLastMintesOfHour

WASABi in Azure
Management Certificate
makecert -sky exchange -r -n "CN=<CertificateName>" -pe -a sha1 -len 2048 -ss My"<CertificateName>.cer"
via azure portal, settings, mgmt certs, upload
backup .pfx with password
export via mmc, certs snap-in, personal, export
put public and private key on machine running autoscaler

Add WASABi nuget
Add Enterprise Library config nuget

Update app.config (right-click)
point to Rules.xml
point to ServiceInfo.xml
add smtp info

Update ServiceInfo.xml
Make sure you save as utf-8 without signature!
Add xsd to schema
Update subscription
Update service
Update roles
Update stabilizer

Update Rules.xml
ConstraintRules eg. ScaleTargetHost min="2" max="6"
ReactiveRules eg. greaterOrEqual operand="averageCPU" than="30"
Operands eg. alias="averageCPU" performanceCOunterName="..."

Update diagnostics.wadcfg
eg. PerformaceCounters scheduledTransferPeriod="PT1M"

Pubish Web Role and Run Web Worker Autoscaler

Custom Operands
When performance counters, queue length or instance count aren't enough
For use by reactive rules only
eg. Queue msg depth, number of files in blob, business tickets, ...
Extend DataPointsParametersElement using IDataPointsCollector

Custom Actions
When adjusting instance count or changing settings isn't enough
eg. change role instance size, scale vm website db storage, send sms messages
Extend ReactiveRuleActionElement using instance of ReactiveRuleAction
Remember to put in your custom namespaces (xmlns="http://myfoo")

Azure Websites 

Categories: Azure Notes

Notes from Windows Azure Websites by Matt Milner

  • Application load balancer
  • Content + configuration in shared storage
  • http://<account>.azurewebsites.net

Publishing

  • FTP, Web Deploy, Continues integration
  • Use EnableCodeMigrations to create the db and seed some default data
  • Use a publishing profile (import on web publish)
  • One ftp location even though you have multiple instances.

Pricing Models

  • Free only up to 10 sites, multi-tenant, limited dns entries, outbound data limits, throttles on cpu and memory usage.
  • Shared is multi-tenant, per site/instance charges, custom domain names, unlimited outbound charged separately.
  • Reserved is vm-size with 1-3 instances, up to 100 sites.

Monitoring
Counters: CPU, Data in/out, Http Errors, Requests
Diagnostics: Error pages, Logging, IIS logs, Failed request

Team Foundation Service
Setup publishing: Authorize and create build definition
Build: Publish to azure on succesful build

Local Git Repository
Setup publishing: Create repository on azure websites
Push: Push to git repository initiates build on azure
Build: Deploy to azure on succesful build

Solution

  • Make sure your dlls are correctly referenced (use nuget)
  • Correct your Web.Release.config (use preview transformation)
  • .gitignore (packages/ bin/ obj/ *.suo *.csproj.user)

Azure

  • Setup Git Publishing
  • git remote add fooazurealias https://<account>/foo.git
  • git push fooazurealias master

Hosted Git Repository
Codeplex, GitHub, BitBucket
Setup publishing: Create repo on azure, authenticate hosted with oauth
Push: Push to hosted, will post notification to azure, azure will clone repo
Link your Azure website to a specific branch on github.com

Windows Azure PowerShell

get-module

get-command -module azure

$mgmtCert = get-item cert:\\currentuser\my\$mgmtCertThumbprint

Set-AzureSubscription -SubscriptionName KensCloud -SubscriptionId $subscriptionID -Certificate $mgmtCert

Select-AzureSubscription -SubscriptionName KensCloud

get-azurewebsite

get-azurelocation

New-AzureWebsite -Location "West US" -Name "fooNew"

$site = get-azurewebsite -Name fooNew

$site

$site.HttpLoggingEnabled = $true

$site.RequestTracingEnabled = $true

$site.NumberOfWorkers = 3

$site | Set-AzureWebsite

Node.js

npm install azure-cli

node azure account download

node azure account import c:\foo\foo.cer

del c:\foo\KensCloud-11-11-2011-credentials.publishsettings

node azure site create KensNode

node azure site browse KensNode

Azure Cloud & Storage Services 

Categories: Azure Notes

Some notes from Windows Azure Fundamentals by http://mattmilner.com

Fabric controller will keep the requested number of instances running.

Package & Configuration files

  • .cscfg is xml stating the os
  • .cspkg is just a zip file

Service Definition

  • Virtual machine sizing
  • Endpoints
  • Certificates
  • Websites (web role)
  • Environment variables
  • Startup tasks
  • Configuration settings declarations

Service configuration

  • Operation System
  • Instance count
  • Values for configuration settings
  • Certificate thumbprint

Managing Cloud Services

  • Affinity groups
  • Fault domains
  • Upgrade domains
  • VIP swap
  • REST API

Storage Services

  • x509 certificate and SSL
  • Storage Account Keys
  • ETags
  • Azure Storage Explorer

Tables

  • PartitionKey, RowKey, Entity (key/value pairs), Timestamp
  • Max 255 fields including keys
  • Matching partition keys = data in same physical partition
  • Transactions only on the same partition

Blobs/CDN

  • Root container - Named container (first dir) - Blob (second dir and filename) 
  • http://<account>.blob.core.windows.net/images/web/background.jpg
  • Block blobs vs Page blobs
  • Content-cache metadata=TTL in CDN

Queues (max. 7 days)

  • No capitals in name allowed
  • 64kb Max after base64 encoded and including xml headers
  • eg. worker role that creates thumbnails or processes video
  • A worker role can update a message.
Page 20 of 43 << < 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 40 > >>