Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Create Image

  • Create an instance.
  • Install htop.
  • Copy the following file.
import random
import time
import sys

if len(sys.argv) != 2:
    exit('Pass the load')

load = int(sys.argv[1])

while True:
    z = 0
    for _ in range(load):
        x = random.random()
        z += z
    time.sleep(0.000001)
  • Shut down the instance.
  • Create an image based on the disk of the instance.
  • Start an instance based on the image, verify it and then destroy it.