cost effective azure

Download Cost effective azure

Post on 17-Jul-2015

64 views

Category:

Documents

3 download

Embed Size (px)

TRANSCRIPT

DYA dag 2009 _10-2-2009_ seminar_overall presentatie

Cost Effective Coding In Windows AzureKogman GalGkogman@gmail.comAgendaDifferent metricsEasing the billVirtual machinesStorageSQL AzureDeveloper awarenessTakeawaysQ&ADifferent metricsTraditional architecture vs. Cloud architectureCapEx (classic investment model)TIMEIT CAPACITYActual LoadAllocated IT-capacitiesOvercapacityUndercapacityFixed cost of IT-capacitiesLoad Forecast

InvestmentOpEx (pay for use)Actual LoadAllocated IT capacitiesReduction of initial investmentsReduction of overcapacityNo undercapacityPossible reduction of IT-capacities in case of reduced loadIT CAPACITYLoad ForecastTIMECapEx vs. OpexTraditional architectureOvercapacity availableAdditional layers / services might not add extra IT investmentsCloud architectureNo overcapacityAdditional layers / services cost money!6You pay for ...Windows AzureSQL AzureAzure AppFabricthe services used+ the data transfer consumedDataCenter7. ingressOutside the datacenter1. Compute2. Storage3. StorageTransactions5. Access Control Transactions6. Service Bus Connections8. egress4. DB8 different parameters???Typically you only use 4-5:Compute hoursSQL Azure databaseStorageData transfer inData transfer out8Complex?No! Here are your datacenter parameters...LicensesOS LicenseSQL Server LicenseHardware investmentServerDisksRacksSwitchesUPSNetwork cables Hardware maintanancePower consumption of hardwareServerDiskRacksSwithesInsurance of hardwareInsurance on server room

Server roomRentCoolingLightingCleaningSmoke detectorsTapes for backupSalary for admin peopleInstall hardwareMaintain hardwareApply OS patchesBackup/Restore operationsFirewall/DMZ configurationClear logfilesTaxes on SalariesTime spent on procurement cycle of hardware / Licenses...9Virtual MachinesEasing the billLimiting virtual machine countDo you need full capacity 24/7?Probably not, reduce # cpus when not usedUse Windows Azure Diagnostics API & Windows Azure Management API to scale (semi)-automatically24 hours x 10 small instances = 20,50 EUR / dayvs.16 hours x 10 small instances+ 8 hours x 4 small instances = 16,4 EUR / dayLimiting virtual machine countStaging environment costsWhen not in use, undeploy the staging environment24 hours x 5 small instances = 10,25 EUR / dayvs.12 hours x 5 small instances = 5,13 EUR / dayWorkers need work!Out of the box, 1 worker role = 1 taskWhy not spin up processes or threads?10 tasks1 task per worker = 20 workers*2 tasks per worker = 10 workers*10 tasks per worker = 2 workers*Which means 41 EUR / day vs. 4,1 EUR / day

* 2 instances minimum for the SLADo you need all of that?1 XL = 2 L = 4 M = 8 S (regarding costs)No need for this memory / disk space?Stay with SScale up/down more granularlyCompute Instance SizeCPUMemoryInstance StorageI/O PerformanceSmall1.6 GHz1.75 GB225 GBModerateMedium2 x 1.6 GHz3.5 GB490 GBHighLarge4 x 1.6 GHz7 GB1,000 GBHighExtra large8 x 1.6 GHz14 GB2,040 GBHighUnemployed? Undeployed!Billing per reserved VMReserved = deployed / runningBilling in staging and production2 instances staging + 2 instances production = 4 instances billedUndeploy your VM if not neededUndeploy staging every eveningAutomate this

Warning!Instance hours are accumulated by each hosted service that contains a deployed project, regardless if the service is running or suspended.

When the box is gray,youre okay.

When the box is bluea bill is due.

Work per hourKeep instances running for at least 59 minutesDont deploy every minute= 60 instance hours per hour!Dont do continuous deployment for every build, but accumulateBandwidth, Storage & TransactionsEasing the billBandwidth?We are used to being economical on this one...Simple metricUse more = pay moreUse less = pay lessWhen am I using bandwidth?Data transfers in/out Windows AzureComputeBlobsAppFabricData transfers between Windows Azure regionsE.g. North America EuropeKeep compute & storage in the same region!Content Delivery NetworkContent distributed across X serversStorage costs = Storage costs for public containers x 2Bandwidth costs = # data in public containers x X serversCan be limited by setting cache headersStorageData you store (non SQL)TablesBlobsQueues

Per GB / month

Average over full month10 GB stored for 15 days, 0 GB stored for 15 days = 5 GB stored for 1 monthTransactions1 transaction = 1 storage operationBilled per 10.000Checking a queue every second from 2 workers172.800 transactions / dayUse a back-off mechanismNo data? Wait a secondAgain no data? Wait two secondsEtc.Transactions1 transaction = 1 storage operationBilled per 10.000Serving 100 images from blob storageHigh traffic app high # transactionsChoose wisely between blob storage and computeDiagnostics monitorWrites data to storage accountDoes not clean upWrite often = # transactionsWrite less = lag in diagnostic dataSQL AzureEasing the billDatabase editionsWeb1 or 5 GBBusiness10, 20, 30, 40, 50 GBDatabase editions1 GB/ Month = $9.995 GB/ Month = $49.95 10 GB/ Month = $99.99 20 GB/ Month = $199.98 30 GB/ Month = $299.97 40 GB/ Month = $399.96 50 GB/ Month = $499.95 + data transfer ingress & egressBilling nuancesBased on peak DB size / dayAveraged over 1 monthActual database edition size used is billed

Examples0.9 GB in a 5 GB web edition costs 1 GB(= $9.99)1.1 GB in a 5 GB web edition costs 5 GB(= $49.95)Tables & indexes cost moneyBe careful with themOnly define indexes neededIndexing every column & not using it may be a waste of money

ExampleIf index costs 0.50 EUR / month & does not add speed, lose itTable with 1 GB of static data on SQL Azure = $ 9.99, on table/blob storage it costs $ 0.12...The Real Cost of Indexes (blogs.msdn.com/b/sqlazure/archive/2010/08/19/10051969.aspx)31Stored proceduresTendency to not use stored procedures nowadaysStored procedure = free!DB is metered on storageMay be a good idea to use stored procedures and lose a worker roleLimitationsThe Real Cost of Indexes (blogs.msdn.com/b/sqlazure/archive/2010/08/19/10051969.aspx)32Developer awarenessEasing the billA code snippet...if (Session["culture"].ToString() == "en-US") { // .. set to English ...}

if (Session["culture"].ToString() == "nl-BE") { // .. set to Dutch ...}

string culture = Session["culture"].ToString();if (culture == "en-US") { // .. set to English ...}

if (culture == "nl-BE") { // .. set to Dutch ...}Developersdirectly impact costs!TakeawaysWhat to remember?TakeawaysCloud pricing != more complexJust different

Quality impacts costsQ&AAny questions?Thank you!

Recommended

View more >