+ All Categories
Home > Documents > 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+...

腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+...

Date post: 20-May-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
33
腾讯游戏容器云平台演进之路 尹烨 高级工程师
Transcript
Page 1: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

腾讯游戏容器云平台演进之路

尹烨 高级工程师

Page 2: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务
Page 3: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务
Page 4: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务
Page 5: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

平台概况

技术方案

总结

Page 6: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

平台概况 •  2014 – now

•  200+ APP、23W+ CPU core、800T+ Mem

•  业务场景

•  轻量虚拟机

•  微服务

•  离线计算(大数据、机器学习

Page 7: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

技术栈

Page 8: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

平台概况

技术方案

总结

Page 9: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

轻量虚拟机

•  System Init(sysvinit /systemd + SSH

•  IP per light-VM

•  Run monitor agent in light-VM

Page 10: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

systemd •  Container Interface

•  container=docker

•  Cgroup is needed

•  udev is not available when mount /sys read-only

•  Systemd defines that shutdown signal as SIGRTMIN+3

•  ...

Page 11: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Network(1)

•  Bridge

•  Bad performance

•  Set veth txqlen=0

Page 12: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Network(2)

•  SR-IOV

•  Good performance

•  Binding VF interrupt

•  Enable RPS

Page 13: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

/proc

•  Lxcfs

•  Kernel support

Page 14: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

微服务

•  Only app in container

•  IP per container ?

•  Monitor

Page 15: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Network - Overview

Page 16: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Underlay to overlay

•  LB

•  http/https/tcp/udp

Page 17: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

VXLAN optimization •  UDP RSS

•  ethtool -N eth10 rx-flow-hash udp4 sdfn

•  VXLAN offload

•  VXLAN GRO

•  Kernel 3.14 (net: Add GRO support for vxlan traffic)

Page 18: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

CNI •  Simple

•  Plugins(macvlan,ipvlan,bridge,multus,…

•  Container runtimes(k8s,rkt,mesos,…

•  SR-IOV CNI(github.com/hustcat/sriov-cni

•  High performance(NFV,Proxy,LB,…

•  VF interrupt CPU binding

•  DPDK supported

Page 19: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

K8S extensions

•  Scheduler plugin

•  Cpuset and NUMA

•  kubernetes#49186 (v1.8?)

Page 20: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Monitor

Page 21: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Log

Page 22: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

离线计算

•  Tensorflow + GPU

•  NVIDIA/nvidia-docker(GPU device、CUDA library

•  Spark

Page 23: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Spark on K8S

•  Native support for submitting Spark applications to a kubernetes cluster.

•  The submitted application runs in a driver executing on a kubernetes pod, and executors lifecycles are also managed as pods.

•  SPARK-18278

•  https://github.com/apache-spark-on-k8s

Page 24: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Architecture

Page 25: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Comparison with Spark Standalone on K8S

•  Elastic

•  Spark executors can be elastic depending on job demands

•  Simple

•  Simplifies the process of running Spark jobs

•  Efficient

•  Only k8s-based resource scheduler

Page 26: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

镜像传输

•  自研企业级镜像仓库

•  P2P传输

Page 27: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

镜像仓库

•  Token认证

•  权限控制

•  操作日志及审计

•  分布式存储

Page 28: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

P2P镜像传输

Page 29: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Kernel •  Overlayfs + XFS

•  Buffer IO throttle

•  Cgroup namespace

•  网络sysctl内核参数隔离

•  Bugfix

Page 30: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Overlayfs + XFS •  Advantage

•  Simple

•  Good IO performance

•  XFS (project quota,inode limit

•  Some problems

•  Inotify(#11705

•  Unix socket(#12080,Kernel 4.7

Page 31: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

平台概况

技术方案

总结

Page 32: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

总结

•  容器重新定义业务部署和资源交付方式

Page 33: 腾讯游戏容器云平台演进之路 - Huodongjia.com · 平台概况 • 2014 – now • 200+ APP、23W+ CPU core、800T+ Mem • 业务场景 • 轻量虚拟机 • 微服务

Recommended