©2014Amazon.com,Inc.anditsaffiliates.Allrightsreserved.Maynotbecopied,modified,ordistributedinwholeorinpartwithouttheexpressconsentofAmazon.com,Inc.Traditional:RigidAWS:ElasticServersDemandCapacityExcessCapacityWasted$$DemandUnmetDemandUpsetPlayersMissedRevenue:(11Regions52EdgeLocationsContinuousExpansion关注于游戏设计本身ELB•Chooseregion•=2AvailabilityZones•AmazonEC2forapp•ElasticLoadBalancing•AmazonRDSdatabase•Multi-AZRegion•AmazonS3forgamedata•Assets•UGC•Analytics•...withCloudFront!•AutoScalingGroup•Capacityondemand•Respondtousers•Automatichealing•AmazonElastiCache•Memcached•Redis•RDSread-replicaELBRegionCloudFrontCDN•Gamesarewriteheavy•Cachingoflimiteduse•Keyvaluepair•Binarystructures•Database=bottleneckELBRegionCloudFrontCDN(notfun)A-ZN-ZA-HI-PELBRegionCloudFrontCDN•Fully-managed•NoSQLdatastore•Provisionedthroughput•Secondaryindexes•PUT/GETkeys•DocumentSupport!•400KBItems•AutoScaling(OSS)ELBRegionCloudFrontCDN全球部署、快速扩展“大世界”高性能、低延迟资源弹性按需伸缩MMO实战模拟:武士对决://bit.ly/superdata-latency100+ms100+ms100+ms100+ms1.GameserversHTTPGameAPIsTokyoOregonFrankfurtVirginiaVPCSubnetVPCSubnetAvailabilityZoneAAvailabilityZoneBVPCSubnetVPCSubnetAutoScalinggroupWEBVPCSubnetWEBJOBSRegion①LoginviaHTTPAPI②DownloadGameAssets③MatchmakingtoGameServerEC2EC2EC2Region①LoginviaHTTPAPI②DownloadGameAssets③MatchmakingtoGameServer④ConnecttoServer⑤HackApartYourFriends⑥GameOverEC2EC2Region①LoginviaHTTPAPI②DownloadGameAssets③MatchmakingtoGameServer④ConnecttoServer⑤HackApartYourFriends⑥GameOver⑦WriteviaHTTPAPIEC2EC2VPCPrivateSubnetVPCPublicSubnetAvailabilityZoneAAvailabilityZoneBVPCPublicSubnetVPCPrivateSubnetGAMEGAMEGAMEGAMEGAMEGAMETokyoOregonFrankfurtVirginia??VPCSubnetAvailabilityZoneAAvailabilityZoneBVPCSubnetAutoScalinggroupWEBWEBOregonTokyoVPCSubnetJOBSRegion•GameAPIbackendpods•Coresession•Matchmaking•S3+CloudFront•DLC,assets•Gamesaves•UGC•Gameserverpod(publicsubnet)•Directclientsocket•Scaleonplayers①LoginviaAPI②Requestmatchmaking③GetgameserverIPRegion①LoginviaAPI②Requestmatchmaking③GetgameserverIP④Connecttoserver⑤Pulldownassets⑥OtherplayersjoinRegionRegionAEC2APIRegionBEC2APIVPCPrivateSubnetVPCPublicSubnetAvailabilityZoneAS3BucketAmazonCloudWatchLogsGAMEGAMEGAMEVPCPrivateSubnetVPCPublicSubnetAvailabilityZoneAAmazonKinesisS3BucketAmazonRedshiftGAMEGAMEGAME://bit.ly/linux-tuningBefore:HypervisorAfter:HardwareIntel®Xeon®v3•Haswellmicroarchitecture•PstateandCstatecontrolgameserverstatelessjennysun@amazon.com