Resource Management with CGroups



Similar documents
Limiting PostgreSQL resource consumption using the Linux kernel

lxc and cgroups in practice sesja linuksowa 2012 wojciech wirkijowski wojciech /at/ wirkijowski /dot/ pl

SLURM Resources isolation through cgroups. Yiannis Georgiou Matthieu Hautreux

Lightweight Virtualization: LXC Best Practices

PARALLELS SERVER BARE METAL 5.0 README

Virtualization Management the ovirt way

PARALLELS SERVER 4 BARE METAL README

RED HAT ENTERPRISE VIRTUALIZATION

The QEMU/KVM Hypervisor

Parallels Cloud Server 6.0 Readme

Parallels Cloud Server 6.0

Cloud Computing with Red Hat Solutions. Sivaram Shunmugam Red Hat Asia Pacific Pte Ltd.

Managing Linux Resources with cgroups

Managing your Red Hat Enterprise Linux guests with RHN Satellite

Performance brief for IBM WebSphere Application Server 7.0 with VMware ESX 4.0 on HP ProLiant DL380 G6 server

KVM Virtualization in RHEL 7 Made Easy

Module I-7410 Advanced Linux FS-11 Part1: Virtualization with KVM

Acronis Backup & Recovery 10 Server for Linux. Update 5. Installation Guide

Maintaining Non-Stop Services with Multi Layer Monitoring

Next Generation Now: Red Hat Enterprise Linux 6 Virtualization A Unique Cloud Approach. Jeff Ruby Channel Manager jruby@redhat.com

HP Device Manager 4.6

ICANWK401A Install and manage a server

Linux Virtualization Nesting and Management

Migrating LAMP stack from x86 to Power using the Server Consolidation Tool

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

System Resources. To keep your system in optimum shape, you need to be CHAPTER 16. System-Monitoring Tools IN THIS CHAPTER. Console-Based Monitoring

Real-Time KVM for the Masses Unrestricted Siemens AG All rights reserved

ServerPronto Cloud User Guide

Container-based operating system virtualization: a scalable, high-performance alternative to hypervisors

ovirt Introduction James Rankin Product Manager Red Hat Virtualization Management the ovirt way

Overview Customer Login Main Page VM Management Creation... 4 Editing a Virtual Machine... 6

Proposal for Virtual Private Server Provisioning

Security and Billing for Azure Pack. Presented by 5nine Software and Cloud Cruiser

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

Virtualizare sub Linux: avantaje si pericole. Dragos Manac

Exam : IBM : Iseries Linux Soluton Sales v5r3

Introduction to ovirt

SPICE and desktop virtualization

GL-250: Red Hat Linux Systems Administration. Course Outline. Course Length: 5 days

Monitoring HP OO 10. Overview. Available Tools. HP OO Community Guides

Acronis Backup & Recovery 10 Server for Linux. Quick Start Guide

Parallels Plesk Panel

How To Install Acronis Backup & Recovery 11.5 On A Linux Computer

CA arcserve Unified Data Protection Agent for Linux

A Highly Versatile Virtual Data Center Ressource Pool Benefits of XenServer to virtualize services in a virtual pool

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

Plesk 8.3 for Linux/Unix System Monitoring Module Administrator's Guide

Selling Virtual Private Servers. A guide to positioning and selling VPS to your customers with Heart Internet

CA ARCserve D2D for Linux

Use Cases for Docker in Enterprise Linux Environment CloudOpen North America, 2014 Linda Wang Sr. Software Engineering Manager Red Hat, Inc.

Xen Virtualization: Xen (source) and XenServer

Disaster Recovery Checklist Disaster Recovery Plan for <System One>

Cloud UT. Pay-as-you-go computing explained

KVM Virtualization in RHEL 6 Made Easy

Developing a dynamic, real-time IT infrastructure with Red Hat integrated virtualization

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

Virtualization. Michael Tsai 2015/06/08

EXPLORING LINUX KERNEL: THE EASY WAY!

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

Citrix XenServer 5.6 OpenSource Xen 2.6 on RHEL 5 OpenSource Xen 3.2 on Debian 5.0(Lenny)

NAS Storage needs to be purchased; Will not be offered IAAS - Utility SMTP Per SMTP account Per server

The Benefits of Verio Virtual Private Servers (VPS) Verio Virtual Private Server (VPS) CONTENTS

OS Installation Guide Red Hat Linux 9.0

JAMF Software Server Installation and Configuration Guide for OS X. Version 9.2

W H I T E P A P E R. Optimized Backup and Recovery for VMware Infrastructure with EMC Avamar

LAMP Server A Brief Overview

AT&T CLOUD SERVICES. AT&T Synaptic Compute as a Service SM : How to Get Started. Version 2.0 January 2012

International Journal of Computer & Organization Trends Volume20 Number1 May 2015

User Guide for VMware Adapter for SAP LVM VERSION 1.2

GL254 - RED HAT ENTERPRISE LINUX SYSTEMS ADMINISTRATION III

FileCruiser Backup & Restoring Guide

Symantec Endpoint Protection Datasheet

Citrix XenServer Product Frequently Asked Questions

Satish Mohan. Head Engineering. AMD Developer Conference, Bangalore

Table of Contents. Online backup Manager User s Guide

JAMF Software Server Installation and Configuration Guide for OS X. Version 9.0

2972 Linux Options and Best Practices for Scaleup Virtualization

Parallels Virtuozzo Containers 4.7 for Linux Readme

Parallels Cloud Server 6.0

Fermilab Central Web Service Site Owner User Manual. DocDB: CS-doc-5372

AirWave 7.7. Server Sizing Guide

Intel Cloud Builder Guide: Cloud Design and Deployment on Intel Platforms

20 Command Line Tools to Monitor Linux Performance

RED HAT ENTERPRISE VIRTUALIZATION FOR SERVERS: COMPETITIVE FEATURES

Oracle Database Scalability in VMware ESX VMware ESX 3.5

Securing your Virtual Datacenter. Part 1: Preventing, Mitigating Privilege Escalation

Cloud Server. Parallels. An Introduction to Operating System Virtualization and Parallels Cloud Server. White Paper.

Red Hat Enterprise linux 5 Continuous Availability

Accessing RCS IBM Console in Windows Using Linux Virtual Machine

JAMF Software Server Installation and Configuration Guide for Linux. Version 9.2

Solution for private cloud computing

Getting Started in Red Hat Linux An Overview of Red Hat Linux p. 3 Introducing Red Hat Linux p. 4 What Is Linux? p. 5 Linux's Roots in UNIX p.

Deployment - post Xserve

HRG Assessment: Stratus everrun Enterprise

Performance Evaluation of VMXNET3 Virtual Network Device VMware vsphere 4 build

<Insert Picture Here> Introducing Oracle VM: Oracle s Virtualization Product Strategy

Transcription:

Resource Management with CGroups Steven Ellis Solution Architect Red Hat New Zealand sellis@redhat.com Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0)

CGroups What are CGroups Why do I need CGroups How do I use CGroups 2 Resource Management with CGroups

What are CGroups In Kernel capability to limit, account and isolate resources CPU Memory Disk I/O Originally developed by Rohit Seth in 2006 under the name Process Containers Kernel merge in 2.6.24, now included in most major distributions 3 Resource Management with CGroups

CGroup Controllers memory: Memory controller Allows for setting limits on RAM and swap usage and querying cumulative usage of all processes in the group cpuset: CPU set controller Binding of processes within a group to a set of CPUs and controlling migration between CPus cpuacct: CPU accounting controller Information about CPU usage for a group of processes cpu: CPU schedular controller Controlling the priorization of processes in the group. Think of it as a more advanced nice level devices: Devices controller Access control lists on character and block devices 4 Resource Management with CGroups

CGroup Controllers blkio: I/O controller for block devices Sets limits on input/output access to and from block devices such as physical drives (disk, solid state, USB, etc.). freezer: Suspend or resumes tasks net_cls: Network Class controller Tags network packets so the Linux traffic controller can identify packets with a particular CGroup 5 Resource Management with CGroups

Why SLA Management Meet application SLAs by reducing resource contention and increasing predictability in performance. Large Virtual Consolidation Prevent single or group of virtual machines monopolising resources., or impacting other environments. Cost based accounting Cost recovery from business units 6 Resource Management with CGroups

When When did I first need CGroups? Even I was surprised 7 Resource Management with CGroups

2009/2010 Mobile Messaging Company Database backups were impacting production services. Very I/O intensive queries and insufficient spindles Global Coverage Scheduling backups was was a major issue. 8 Resource Management with CGroups

2006 Multiple Websphere JVM's on shared hardware. Memory leaks and CPU peaks were impacting other business services. 9 Resource Management with CGroups

2003-2004 Multi Vendor JVM testing Red Hat Enterprise Linux Releases 2.1 and 3 JRockit had some interesting performance characteristics Can not SSH into host. Physical TTY would timeout before login. Power button wouldn't work. 10 Resource Management with CGroups

Too Far back 11 Resource Management with CGroups

1998-1999 UK Based Development House Red Hat 5.0 Primary Server IMAP email Samba / AFS / NFS GNU Cross-Compilers GDB over serial for Embedded Hardware Remote X via VNC to Mac Workstations Boss isn't getting his email 12 Resource Management with CGroups

Modern Challenge - Virtualisation Hosting providers requires QoS (quality of service guarantees based on pricepoint) 40% net 40% net 20% net Network Virt Guest A 50% CPU 50% Mem Virt Guest B 25% CPU 25% Mem Virt Guest C 25% CPU 25% Mem 60% 20% 20% I/O Storage 13 Resource Management with CGroups

How 14 Resource Management with CGroups

Using CGroups Install cgroups support yum install libcgroup apt-get install cgroup-bin libcgroup1 Setup a basic /etc/cgconfig.conf mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; memory = /cgroup/memory; } Start the cgroups daemon service cgconfig start 15 Resource Management with CGroups

Command Line Tools cgexec Start new process in specified group(s). cgclassify Move process to specified group(s). cgcreate / cgdelete Create and remove cgroups manually cgset Modify defined cgroup 16 Resource Management with CGroups

Subsystems - memory Limit memory usage of processes in a group Parameters (see memory.txt): memory.limit_in_bytes maximum allowed memory usage by tasks in the group. memory.max_usage_in_bytes maximum of used memory. memory.stat current memory statistics (RSS, swap,...) Examples: HTTP can take only 30% of memory. 17 Resource Management with CGroups

Subsystems - cpu Set scheduler priority. Parameters: cpu.shares priority of threads in this group, relative to other groups. Example: SQL can take 2x more CPU cycles than HTTP. 18 Resource Management with CGroups

Subsystems - cpuacct Computes CPU cycles, burned by members of the group. Parameters: cpuacct.usage nr. of cycles. cpuacct.usage_percpu nr. of cycles per CPU. Example: Members of 'developers' used 107 cpu cycles. Out of that, only 2x10 6 cpu cycles were exhausted by mysql. 19 Resource Management with CGroups

Apache Example Edit /etc/cgconfig.conf group http { memory { memory.limit_in_bytes = 1024M; } } Next, add this to the /etc/sysconfig/httpd.conf: CGROUP_DAEMON="memory:/http" The start cgconfig service and httpd 20 Resource Management with CGroups

CGroups and Virtual Machines Allows to control libvirtd and any other process in the cgroup virt Examples are memory ceiling / capping Restrict which CPUs libvirt can utilise Add these rules to /etc/cgconfig.conf group virt { memory { memory.limit_in_bytes = 3.5G; } cpuset { cpuset.cpus = 1-3; } } Modify /etc/sysconfig/libvirtd and add CGROUP_DAEMON="memory:/virt 21 Resource Management with CGroups

Subsystems - blkio Manages block and char I/O devices proportional weight-based disk access Weight from 1-1000 Upper limit throttling Specify a fixed number of bps per device 22 Resource Management with CGroups

Blkio Demo # restart cgroups service cgconfig restart # Setup the throttle as zero and then play with it. cd /cgroup/blkio/ echo 253:0 $((0*1024*1024)) > blkio.throttle.write_bps_device #Monitor I/O with iostat dm-0 3 # Then start DD on the volume while true; do dd if=/dev/zero of=/tmp/test.out; done # Adjust blkio throttle and check iostart output echo 253:0 $((20*1024*1024)) > blkio.throttle.write_bps_device echo 253:0 $((10*1024*1024)) > blkio.throttle.write_bps_device echo 253:0 $((1*1024*1024)) > blkio.throttle.write_bps_device 23 Resource Management with CGroups

References RHEL 6 Resource Management Guide http://docs.redhat.com/docs/en- US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide Fedora Overview http://fedoraproject.org/wiki/features/controlgroups Manage Your Performance with Cgroups and Projects http://broadcast.oreilly.com/2009/06/manage-your-performance-with-cgroups-andprojects.html Zonker at ServerWatch on Cgroups http://www.serverwatch.com/tutorials/article.php/3920051/introduction-to-linux- Cgroups.htm Using Cgroups under Debian http://hydra.geht.net/tino/english/faq/debian/squeeze/cgroups/ 24 Resource Management with CGroups

Images Clipart http://www.cksinfo.com/clipart/electronics/phones/mobilephones/camera-phone.png Corporate logos (c) current owners. Pointy Headed Boss c/o Scott Adams Used under fair use, please contact me if you want this removed. 25 Resource Management with CGroups