Deterministic Container Resource Management in Derivative Clouds - - PowerPoint PPT Presentation

deterministic container resource management in derivative
SMART_READER_LITE
LIVE PREVIEW

Deterministic Container Resource Management in Derivative Clouds - - PowerPoint PPT Presentation

Deterministic Container Resource Management in Derivative Clouds Chandra Prakash, Prashanth, Umesh Bellur, Purushottam Kulkarni Department of Computer Science and Engineering Indian Institute of Technology Bombay 19 th April, 2018 International


slide-1
SLIDE 1

Deterministic Container Resource Management in Derivative Clouds

Chandra Prakash, Prashanth, Umesh Bellur, Purushottam Kulkarni

Department of Computer Science and Engineering Indian Institute of Technology Bombay

19th April, 2018 International Conference on Cloud Engineering

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 1 / 26

slide-2
SLIDE 2

Derivative cloud

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 2 / 26

slide-3
SLIDE 3

Dual control over resources

◮ Hypervisor and guest OS both control the same resources ◮ Hypervisor not aware of containers requirements

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 3 / 26

slide-4
SLIDE 4

Hypervisor mechanism under consideration

◮ Ballooning is used to achieve memory overcommitment1 ◮ vCPU scaling is used to reduce scheduling overheads in over

committed situation 2

  • 1C. A. Waldspurger, "Memory resource management in vmware esx server," ACM SIGOPS Operating Systems Review, vol.

36, no. SI, pp. 181-194, 2002.

  • 2L. Cheng, J. Rao, and F. Lau, "vscale: automatic and efficient processor scaling for smp virtual machines," in Proceedings
  • f the 11th European Conference on Computer Systems, ACM, 2016.

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 4 / 26

slide-5
SLIDE 5

Undesirable effects due to ballooning

Happens Desired Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 5 / 26

slide-6
SLIDE 6

Existing memory reclamation in containers

◮ Memory provisioning knobs: Hard-Limit and Soft-Limit ◮ exceed: difference between memory usage and Soft-Limit ◮ SMR (Soft Memory Reclaimed): memory reclaimed from local LRU ◮ GLR (Global LRU Reclaimed): memory reclaimed from global LRU

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 6 / 26

slide-7
SLIDE 7

Existing memory reclamation in containers

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 7 / 26

slide-8
SLIDE 8

Impact of ballooning

Set-up

◮ Memory reclamation rate: 2 GB every 30 seconds (generated

from host after 100 seconds)

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 8 / 26

slide-9
SLIDE 9

Impact of ballooning

Default configuration of four containers

Container Hard-limit(GB) Soft-limit(GB) Key size (# records) Redis-Low 2 0.5 500K Redis-High 4 1 1000K Mongo-Low 2 0.5 500K Mongo-High 4 1 1000K

0.5 1 1.5 2 2.5 3 3.5 50 100 150 200 250 300 350 400

Memory usage ratio Time (sec)

MongoDB ratio Redis ratio Desired ratio

Memory usage ratio Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 9 / 26

slide-10
SLIDE 10

Impact of ballooning

◮ Existing knobs (limits) do not guarantee proportionate

memory allocation during memory pressure situations

0.5 1 1.5 2 2.5 3 3.5 50 100 150 200 250 300 350 400

Memory usage ratio Time (sec)

MongoDB ratio Redis ratio Desired ratio

Memory usage ratio Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 10 / 26

slide-11
SLIDE 11

CPU provisioning Issues

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 11 / 26

slide-12
SLIDE 12

Impact of vCPU scaling

Experimental setup

VM configuration 7 vCPUs and 8GB Memory Number of containers inside VM 3 CPU allocation ratio 1:1:4 Benchmark Sysbench vCPU scaling down frequency 1 vCPU every 120s (vCPU1,2,3,&4) vCPU mapping using cpuset.cpus C1: vCPU1, C2: vCPU2, C3: vCPU3,4,5,&6

100 200 300 400 1-120 121-240 241-360 361-480 481-600

  • Avg. %CPU utilization

Time Range(S)

Container1 Container2 Container3

CPU utilization without pinning

100 200 300 400 1-120 121-240 241-360 361-480 481-600

  • Avg. %CPU utilization

Time Range(S)

Container1 Container2 Container3

CPU utilization with pinning Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 12 / 26

slide-13
SLIDE 13

Impact of vCPU scaling

◮ Pinning and scaling =

⇒ non-deterministic CPU utilization

◮ Desired goal: achieve pinning benefits + maintain CPU share

100 200 300 400 1-120 121-240 241-360 361-480 481-600

  • Avg. %CPU utilization

Time Range(S)

Container1 Container2 Container3

CPU utilization without pinning

100 200 300 400 1-120 121-240 241-360 361-480 481-600

  • Avg. %CPU utilization

Time Range(S)

Container1 Container2 Container3

CPU utilization with pinning Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 13 / 26

slide-14
SLIDE 14

Summary of issues in nesting setup

◮ Ballooning may fail to satisfy container requirements ◮ vCPU scaling may not respect cpu share with cpu pinning

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 14 / 26

slide-15
SLIDE 15

Our approach

◮ Native cloud provider can be public or private ◮ We can’t control or change hypervisor in case of public cloud ◮ We provide solution at guest OS level

Default approach Our approach Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 15 / 26

slide-16
SLIDE 16

Proposed memory policies

Proportionate memory allocation

◮ Allocate memory according to credit share of containers

Application-specific differentiated memory reclamation

◮ Protect memory sensitive container(s) from memory reclamation

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 16 / 26

slide-17
SLIDE 17

Proposed CPU policies

Maximize dedicated vCPU while maintaining allocation ratio

◮ To get maximum benefits of pinning

Provide pinned vCPU(s) to a subset of containers

◮ Based on application nature or user requirement

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 17 / 26

slide-18
SLIDE 18

Contribution

◮ Modified the memory reclamation logic in memory cgroup

subsystem

◮ Provided an additional definition of exceed ◮ Performed several modifications in Linux kernel » Added extra parameters in memory and cpu cgroups » Added control to maximize SMR » Provided knob to control reclamation chunk size ◮ Created a cpuset calculator in user space

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 18 / 26

slide-19
SLIDE 19

Modified memory reclamation

» exceed = memory_usage – proportionate_share

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 19 / 26

slide-20
SLIDE 20

Effectiveness of memory policies

◮ Ratio of memory weights: 1:2

0.5 1 1.5 2 2.5 3 3.5 50 100 150 200 250 300 350 400 MongoDB ratio Redis ratio Desired ratio

Time (sec) Memory usage ratio

pressure No memory Memory pressure exceed of all ≰ 0 Memory pressure exceed of all ≤ 0

Memory usage ratio (default)

0.5 1 1.5 2 2.5 3 50 100 150 200 250 300 350 400 MongoDB ratio Redis ratio Desired ratio

Time (sec) Memory usage ratio Memory usage ratio (with control)

◮ Able to maintain memory usage ratio when exceed of all

containers become less than or equal zero (after 300 second)

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 20 / 26

slide-21
SLIDE 21

Application specific reclamation

200 400 600 800 1000 1200 1400 100 200 300 400 500 600

Memory usage (MB) Time (sec)

TPC-C: default TPC-C: with control YCSB: default YCSB: with control Free Memory

Memory usage

200 400 600 800 1000 1200 1400 1600 1800 100 200 300 400 500 600

Throughput (op/sec) Time (sec)

YCSB: default YCSB: with control

YCSB throughput

◮ Memory is not reclaimed from YCSB application container

(memory sensitive) and it’s throughput remains intact

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 21 / 26

slide-22
SLIDE 22

vCPU reallocation design

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 22 / 26

slide-23
SLIDE 23

Effectiveness of vCPU reallocation

Experimental setup

VM configuration 7 vCPUs and 8GB Memory Number of containers inside VM 3 CPU allocation ratio 1:4:5 Benchmark Sysbench & Twitter VCPU scaling down frequency 1 vCPU every 120s (vCPU1,2,3,& 4)

100 200 300 400 1-120 121-240 241-360 361-480 481-600

  • Avg. %CPU utilization

Time Range(S)

Container1 Container2 Container3

CPU utilization by each container

500 1000 1500 2000 2500 3000 3500 100 200 300 400 500 600

Throughput (op/sec) Time (sec)

With pinning Without pinning

Twitter throughput with scaling down vCPUs

◮ Able to maintain CPU share along with pinning

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 23 / 26

slide-24
SLIDE 24

Conclusion & future work

Conclusion:

◮ Quantified the impact of hypervisor actions on containers running

inside VM

◮ Proposed user-defined policies to mitigate the impact of

hypervisor actions

◮ Demonstrated the effectiveness of memory and CPU policies

empirically Future work:

◮ Design an efficient algorithm for container placement in derivative

(nested) setup

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 24 / 26

slide-25
SLIDE 25

Thank you Questions???

Email id: chandrap@cse.iitb.ac.in

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 25 / 26

slide-26
SLIDE 26

Modifications in Linux kernel

◮ Added a weight parameter in memory cgroup and a pin

parameter in cpu cgroup.

◮ Modified the balance_pgdat() routine (Linux kernel version 4.7).

Listing 1 : Original reclamation logic

For every reclamation request : SMR( ) ; GLR ( ) ;

Listing 2 : Modified reclamation logic

For every reclamation request : NoOfReclaimedPages = SMR( ) ; i f ( NoOfReclaimedPages ==0): GLR ( ) ; ◮ Created a kernel module to control the reclamation chunk size.

Chandra Prakash Deterministic Container Resource Management in Derivative Clouds 26 / 26