AWS Basics: How AWS EC2 Pricing Works + Examples

文章推薦指數: 80 %
投票人數:10人

Price is one of the biggest problems people have with AWS. And that's pretty understandable. PriceisoneofthebiggestproblemspeoplehavewithAWS. Andthat’sprettyunderstandable. SomeAWSservicesareexpensiveandthedatatransfercostsaren’teasytounderstand.Butforthemostpart,peoplerackuphugebillsbecausetheyneverlearnedhowAWSpricingworks.That’swhyit’simportanttogetagoodgrasponthefundamentalsbeforecommittinglotsofmoneytoanyservice.Today,we’retalkingaboutpricinginthecontextofthemostcommonlyusedAWSservice-ElasticComputeCloud(EC2). AccordingtocloudeconomistCoreyQuinn,EC2isalmostalwaysthebiggestspendcategory.Putsimply,ifyoudon’tknowhowEC2pricingworks,you’regoingtohaveabadtimewithAWS.Let’sgetstarted.AWSPricingFundamentalsBeforedivingintospecificservices,youfirstneedtounderstandthefundamentalsbehindAWS’spricing.Fortunately,they’reprettylogicalandstraightforward. Inshort,therearethreemainAWSpricingprinciples:On-demandpaymentsReservingcapacityVolume-baseddiscountsSource-AWSpricingpageOn-DemandPricing Thisiswhatpeopleassociatewiththecloud.On-demandletsyouuseservicesandpayonlyfortheresourcesyouconsume. WithAWS,youpayforthismodelbythehourorbythesecond.On-demandsavesyoufromthedreadedbusinessofplanningaheadandactuallythinkingabouthowyourinframightlookayearfromnow.Advantages:Flexibility,nocommitmentsandeaseofuseDisadvantages:ThemostexpensivepricingmodelBestusecases:Testing,smallorunpredictableworkloadsWhilecloudproviderssellthedreamofon-demandusage,inreality,that’snotaviablemodelinthelong-run.Pay-as-you-goisincrediblyexpensive,nomatterhowyoulookatit.AssoonasyougetcomfortablewithAWS,youshouldthinkaboutreservingcapacitytosavemoney.ReservingCapacitySomeAWSservices,includingEC2,canbereservedinadvance.Thismeansthatyoucommittoaspecifictimeframeinexchangeforadiscount.Now,justbecauseyoureserveaserviceforayeardoesn’tmeanyouhavetopayforitrightaway.Youcandosoifyouwant,butyoucanalsopayapartialupfrontfeeandstillgetasmalldiscount.Source-AWSpricingpageAdvantages:Budgetpredictability,discounts Disadvantages:Lackofflexibility,requiresplanningBestusecases:Well-established,predictableworkloadsReservingcapacitymightnotbeasexcitingason-demand,butit’swaymoreviable.Asyourbusinessgrows,thismodelletsyouplanyourbudget,getadiscountandminimizeriskatthesametime.Volume-BasedDiscounts Thisfinalpointisalsoprettylogical.Asyourusageincreases,yougetdiscountsbasedonthevolumeyourunthroughAWS.S3isagreatexampleofthisprinciple.Sinceit’satieredservice,themoreyouuseit,thelessyoupayperGB. Putsimply,asyourinfrastructuregrows,youcanbenefitfromAWS’smassiveeconomiesofscale.Notmuchmoretosayhere.AWSEC2PricingExamplesAsIalreadysaid,EC2makesupmostofthecostsinatypicalAWSaccount.That’swhyit'simportanttogetfamiliarwithEC2pricingfirst.TherearefivewaystopayforEC2instances:On-DemandSavingsPlansReservedInstancesSpotInstancesDedicatedHostsForthisarticle,I’vechosenarandom,ComputeOptimizedinstance-c5n.4xlargeintheUSEast(Ohio)region.  We’lldothatthroughtheEC2calculator(withoutchanginganything)andseehowmuchwepaywitheachofthefiveoptions.Butfirst,let’squicklylookattheEC2freetier.EC2FreeTierYoucanuseupto750hoursofLinuxorWindowst2.microinstancesforoneyearforfree.Herearethet2.microinstancespecs:Source-EC2instancetypespageAsyoucansee,it’snotsomethingamazing,butyoucanstilldoalotwithit.Ifyou’rejustlearningAWS,youcaneasilyworkontonsofstuffwithoutcrossingthelimit.Justremember:EC2mighthaveafreetier,butsomeotherservicesdon’t.Ifyouuseacombinationofservices,alwayschecktheirspecificpricingpages.Also,datatransferpricesstillapplyevenwithinthefreetier.On-DemandAsIalreadysaid,ingeneraltheon-demandisexpensive.EC2instancesaren’tanexceptiontothisrule.Here’showmuchwe’llhavetopayforourc5n.4xlargeinstanceintheUSEast(Ohio)regionifweuseiton-demandforayear:Source-EC2calculatorAgain,thisiswithoutchanginganyofthedefaultsettings.SavingsPlansSavingsPlansarearelativelynewconcept.Theyletyoucommittoa1or3yearlevelofcomputeusage,measuredin$perhour.Thatway,youstillgetpredictabilitywithoutselectingspecificinstancetypes,i.e.youkeepalotofflexibility.Here’showourinstancepricinglooksafter1-yearwithSavingsPlanswithoutanupfrontpayment:Source-EC2calculatorIfwedecidetopayupfront,themonthlydiscountgetsmuchlarger:Source-EC2calculatorFormostsmallcompanies,SavingsPlansarethewaytogo.They’reeasytoworkwithandprovideauniquecombinationofpredictabilityandflexibility.ReservedInstancesReservedInstancesaresimilartoSavingsPlanswithonekeydifference-youreserveaspecificinstance(likec5n.4xlarge),notacomputeusagelevel.Obviouslybothprovidesimilarbenefits,butReservedInstancesareabittrickiertogetright.Youhavetochooseaspecificinstance,whichcanbetime-consumingsincetherearemanyoptions.Also,youpayforthefullreservedcapacity,evenifyouutilizeonlyapartofit.Here’sourreservedinstancepricingfor1-yearwithnoupfrontpayment:Source-EC2calculatorAndwithapartialupfrontpayment:Source-EC2calculatorAsyoucansee,thepricesarenearlyidenticaltotheSavingsPlansexample.Also,withReservedInstances,youhavetheoptiontoreserveconvertibleinstances.Theseinstancescostmorebecausetheyallowyoutoswitchbetweeninstancetypesduringthereservedperiod.SpotInstancesSpotInstancesprovidethelargestpossiblediscountandarethehardesttomanage.Essentially,theyareawayforAWStomakemoneyfromtheirunusedcomputingcapacity.Youcanrenttheseunusedresourcesforupto90%offtheon-demandprice.ThecatchisthatAWScanterminateyourspotinstancewitha2-minutenoticeifsomeonecomesalongandpaysfullpriceforit.Workingwiththeseinstancestakesmoreskill,especiallyatscale.However,thereareentirebusinessesthatrunonspotonly. Here’showmuchwe’dpayforourinstance,basedonhistoricaldataaboutitsaveragediscount:Source-EC2calculatorAsyoucanseeit’smuchcheaperthananythingelse.Ifyou’rejuststartingout,don’tuseSpotInstancesforbusiness-criticalworkloads,butifyouwanttoexperiment,SpotInstancesareyourbestfriend. DedicatedHostsIwon’tgoin-depthonthisfinaloptionsincefewpeopleactuallyuseit.DedicatedHostsarephysicalserversthatyouessentiallyrentfromAWS. TheystayinAmazon’sdatacentersandAWStakescareofcleaning,maintainingandupdatingthehardware.Asageneralrule,theothermodelsseparatecustomersonlyonthesoftwarelevel.Physicalmachinesareusuallysharedbetweenmultipleusers.That’swhyDedicatedHostsareincrediblyexpensiveandarerarelyused.Forexample,companiesrentdedicatedphysicalmachinesbecauseofregulatory/complianceconcerns.FinalThoughtsAWSpricingcangetalotmorecomplexthanwhatwejustcovered.Butifyoulearnthebasicswell,everythingelsegetseasier.Ifyou’reeagerforsomethingmoreadvanced,I’drecommenddivingdeepintoAWSdatatransfercosts.It’sacomplicatedtopicthatfewpeopleunderstandin-depth.Finally,ifyouwanttoalignyourcloudspendandperformancewithyourbusiness,don’thesitatetodropusaline. 10 Like Comment Share Tovieworaddacomment,signin Tovieworaddacomment,signin AWS&DEVOPSRECAP: OCTOBER2020 Nov6,2020 CLOUDTRENDSFOR2021: MULTICLOUD,HYBRIDCLOUDANDCLOUDREPATRIATION Oct29,2020 AWSBASICS: 8SERVICESEVERYONEWORKINGWITHAWSSHOULDLEARN Oct21,2020



請為這篇文章評分?