save millions by e cient resource utilization through mesos2010 ~560 services 15 mloc 2018 ~2000...

Post on 26-Jun-2020

0 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Save Millions By Efficient Resource Utilization Through Mesos

u By Smarth Madan

PayPal and its Code is growing YOY <WIP>

2010 ~560 Services

15 MLOC

2018 ~2000 Services

80 MLOC

2014 ~1021 Services

45 MLOC

Test Cycle at PayPal Before Managed Stage

Secure VM Configure VM

Code

Deploy on VM

Learn, Debug & Troubleshoot

Failing Services

Up Rev Dependent

Services + DB Schema

Test

Keep your Dependent Services UP

Developer Pain points

Deploying all the components

Tons of time for setup and test

Identifying transitive dependencies

Maintaining stable environment

Infrastructure Team Pain points

Hardware requirements grows YOY

Huge Maintenance cost for ~4K test Environment

Network Bandwidth

Test topology is not same prod

Requirements

o  We need Production Like environment

o  Cluster of machines running all services

o  Multiple instances of each service with auto healing for availability

o  Needed to scale as the number of users grow

o  Code refresh in mins

o  Easy to connect from all other VMs

Resource Management

o  Manage a large set of machines in terms of compute

o  Moving away from static allocation of machines

o  Identifying unused capacity

o  Slave Categorization (diverse PayPal Tech stack)

Job Scheduler

o  Defines jobs with ordered tasks

o  Binding jobs to specific salves using constraints

o  Auto-healing

o  REST API capability

o  Final task to cleanup the slave for any new job

What’s a Managed Stage?

Managed Stage is a continuously available Mesos based multi-node staging

environment that allows Developers and Quality engineers to certify and

release apps to LIVE.

Managed Stage Architecture

CC

Standby Mesos Master Standby Mesos Master Active Mesos Master

Standby Aurora Standby Aurora

Scheduler Active Aurora Scheduler

DB

Mesos slaves

Router Pool

Pool Front Pool Mid

Pool Back

Other pools

Zookeeper 1

Zookeeper 3

Zookeeper 2

Sample Aurora Task

Complex Job Scenario

Dynamic Service Discovery & Registration

CC

Standby Mesos Master Standby Mesos Master Active Mesos Master

Standby Aurora Standby Aurora

Scheduler Active Aurora Scheduler

DB

Mesos slaves

Router Pool

Pool Front

Pool Mid Pool Back

Other pools

Zookeeper 1

Zookeeper 3

Zookeeper 2

Job

Code Refresh Cycle

o  In-place and Full deploy o  5000 Total number of packages gets deployed

•  Full Deploy takes < 1 Hr •  Incremental deploy < 20 Mins

o  Code refresh frequency : •  Daily code refresh incrementally •  Biweekly full code refresh

Dependent Stage

MANAGED STAGE ENVIRONMENT

1000+ services

Foo [N+1]

Foo [N+1]

HAPROXY

Advantage

o  Developer •  Stage setup is reduced by 90% •  Increased productivity by 30 - 40% •  Abstracting all transitive dependencies

o  Infrastructure •  Optimized resource utilization •  Reduced hardware cost in data center •  Less network traffic for deploy

Test Cycle at PayPal After Managed Stage

Code

Deploy Your Service On UserStage

Test

Self-Serv

UserStage

Managed Stage Versions

18

MsMaster (Live)

         

N

R  

S  

H

C  

N

R  

S  

H

C  

N

R  

S  

H

C  

MsRelease (N+1)

         

N

R  

S  

H

C  

N

R  

S  

H

C  

N

R  

S  

H

C  

MsLnP

         

N

R  

S  

H

C  

N

R  

S  

H

C  

N

R  

S  

H

C  

Why Mesos ?

o  CI on Mesos was a success at PayPal

o  Setup cost and time is really low

o  Mesos & Aurora : an out-of-the-box solution

o  Docker integration in future

Cost Analysis

o  No. of VM : ~ 5000

o  Average Stage size : 16 CPU, 64 GB RAM, 256 GB HDD

o  Total CPU : 80,000

o Total CPU used in Managed Stage : 1500/env

o  Reclaimed CPU : 40,000 (just by 50% reduction)

Roadmap o  Using network isolation which was introduced in Mesos 0.22.0 o  Elastic scaling bases on usage patterns

o  Merging clusters with CI

o  Exploring Docker for containerizing pools

Vision

With a click of a button, you can create your own environment with components of specific versions.

Q&A

Thanks

top related