201507131408448146

40
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

Transcript of 201507131408448146

Page 1: 201507131408448146

© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

Page 2: 201507131408448146
Page 3: 201507131408448146

Traditional: Rigid AWS: Elastic

Servers

Demand

Capacity

Excess Capacity

Wasted $$

Demand

Unmet Demand

Upset Players

Missed Revenue :(

Page 4: 201507131408448146

11 Regions

52 Edge Locations

Continuous Expansion

Page 5: 201507131408448146

关注于游戏设计本身

Page 6: 201507131408448146

ELB

• Choose region

• >=2 Availability Zones

• Amazon EC2 for app

• Elastic Load Balancing

• Amazon RDS database

• Multi-AZ

Region

Page 7: 201507131408448146

• Amazon S3 for game data

• Assets

• UGC

• Analytics

• ... with CloudFront!

• Auto Scaling Group

• Capacity on demand

• Respond to users

• Automatic healing

• Amazon ElastiCache

• Memcached

• Redis

• RDS read-replica

ELB

Region

CloudFront

CDN

Page 8: 201507131408448146
Page 9: 201507131408448146
Page 10: 201507131408448146

• Games are write heavy

• Caching of limited use

• Key value pair

• Binary structures

• Database = bottleneck

ELB

Region

CloudFront

CDN

Page 11: 201507131408448146

(not fun)

A-ZN-Z

A-H

I-P

Page 12: 201507131408448146

ELB

Region

CloudFront

CDN• Fully-managed

• NoSQL data store

• Provisioned throughput

• Secondary indexes

• PUT/GET keys

• Document Support!

• 400 KB Items

• Auto Scaling (OSS)

Page 13: 201507131408448146

ELB

Region

CloudFront

CDN

Page 14: 201507131408448146

全球部署、快速扩展

“大世界”

高性能、低延迟

资源弹性按需伸缩

MMO实战模拟:武士对决

Page 15: 201507131408448146

http://bit.ly/verizon-latencyhttp://bit.ly/superdata-latency

Page 16: 201507131408448146
Page 17: 201507131408448146

100+ms 100+ms

100+ms100+ms

Page 18: 201507131408448146

1. Game servers

HTTP Game APIs

Page 19: 201507131408448146

Tokyo

Oregon

Frankfurt

Virginia

Page 20: 201507131408448146

VPC Subnet

VPC Subnet

Availability Zone A

Availability Zone B

VPC Subnet

VPC Subnet

Auto Scaling group

WEB

VPC Subnet

WEB

JOBS

Page 21: 201507131408448146

Region

① Login via HTTP API

② Download Game Assets

③ Matchmaking to Game Server

EC2

EC2

EC2

Page 22: 201507131408448146

Region

① Login via HTTP API

② Download Game Assets

③ Matchmaking to Game Server

④ Connect to Server

⑤ Hack Apart Your Friends

⑥ Game Over EC2

EC2

Page 23: 201507131408448146

Region

① Login via HTTP API

② Download Game Assets

③ Matchmaking to Game Server

④ Connect to Server

⑤ Hack Apart Your Friends

⑥ Game Over

⑦ Write via HTTP APIEC2

EC2

Page 24: 201507131408448146

VPC Private Subnet

VPC Public Subnet

Availability Zone A Availability Zone B

VPC Public Subnet

VPC Private Subnet

GAME GAME GAME GAME GAME GAME

Page 25: 201507131408448146

Tokyo

Oregon

Frankfurt

Virginia

?

?

Page 26: 201507131408448146

VPC Subnet

Availability Zone A Availability Zone B

VPC Subnet

Auto Scaling group

WEB WEB

Oregon

Tokyo

VPC SubnetJOBS

Page 27: 201507131408448146
Page 28: 201507131408448146

Region

• Game API backend pods

• Core session

• Matchmaking

• S3+CloudFront

• DLC, assets

• Game saves

• UGC

• Game server pod(public subnet)

• Direct client socket

• Scale on players

Page 29: 201507131408448146

① Login via API

② Request matchmaking

③ Get game server IP

Region

Page 30: 201507131408448146

① Login via API

② Request matchmaking

③ Get game server IP

④ Connect to server

⑤ Pull down assets

⑥ Other players join

Region

Page 31: 201507131408448146

Region A

EC2 API

Region B

EC2 API

Page 32: 201507131408448146

VPC Private Subnet

VPC Public Subnet

Availability Zone A

S3 Bucket

Amazon CloudWatch Logs

GAME GAME GAME

Page 33: 201507131408448146

VPC Private Subnet

VPC Public Subnet

Availability Zone A

AmazonKinesis

S3 Bucket

Amazon Redshift

GAME GAME GAME

Page 34: 201507131408448146

http://bit.ly/ec2-enhanced-net

http://bit.ly/linux-

tuning

Page 35: 201507131408448146

Before:

Hypervisor

After:

Hardware

Page 36: 201507131408448146

Intel® Xeon® v3

• Haswell microarchitecture

• P state and C state control

Page 37: 201507131408448146
Page 38: 201507131408448146

game server stateless

Page 39: 201507131408448146