Configure Resource Limits

1 hour
  • 4 Learning Objectives

About this Hands-on Lab

In this lab, you are required to configure resource limits for a container. First, you will need to create a container with a Centos7 image. After that, you need to set a CPU limit to 30% of the sum total available compute power. Then, set the RAM limit to 50MB. Lastly, you need to set the network I/O limit to 50Mbit.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a container with Centos 7 image

Use the following command to create a container with a Centos 7 image:

lxc launch images:centos/7/amd64 our-container
Set CPU Limit to 30% of the sum total available compute power

Use the following command to set the CPU limit to 30% of the sum total available compute power:

lxc config set our-container limits.cpu.allowance 30%
Set RAM Limit to 50MB

Use the following command to set the RAM limit to 50MB:

lxc config set our-container limits.memory 50MB
Set Network I/O Limit to 50Mbit

Use the following commands to set the network I/O limit to 50Mbit:

lxc profile device set default eth0 limits.ingress 50Mbit
lxc profile device set default eth0 limits.egress 50Mbit

Additional Resources

Create a container from a centos 7 image and impose resource usage restrictions on the container:

  • 30% sum total CPU compute power

  • 50MB of RAM

  • MAX upload speed 50Mbit

  • MAX download speed 50Mbit

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?