Orka Cluster 3.2 Scheduled Caching

Overview

🗒️

Scheduled Caching is only available for:

  • Orka Cluster 3.2+
  • Mac computers based on Apple Silicon

Scheduled caching enables users to configure an Orka clusters to proactively pull VM images, avoiding long startup times when the VM is first run. This also provides predictable behavior for continuous integration (CI) builds.

The first time a VM is run on a node, the image needs to be cached locally on that node. Due to various factors (such as image size, network conditions, and node utilization), this operation can take several minutes to complete. The Orka Caching feature allows admin users to execute these caching operations in advance of running a VM locally on a node to avoid this latency.

Waiting long periods for the caching operation before a VM can be run can be frustrating, so to solve this problem, MacStadium created the Scheduled Caching feature. Now, when an Admin deploys an image to the cluster, the Scheduled Caching feature allows the user to run a one simple CLI command to cache the image on a node. Then, at VM startup, the image loads without having to pull it from the network first.

The cluster knows which nodes have images cached, greatly reducing image loading and scheduled downtime. Scheduled Caching is an asynchronous operation.This produces faster and predictable VM image startup time. A normal load time is now 5 seconds, which greatly reduces downtime.

🗒️

NOTES

Orka Admins can:

  • Add images to cache (add)

Orka Admins and Orka Users can:

  • Get cache information about a particular image (info)
  • List all images in the cache (list)

Summary

Scheduled Caching is exposed via the orka3 imagecache sub-command. The following table identifies the three main actions users can take.

View Cached Images

To view a lists of cached images across nodes, follow these steps:

  1. Open the CLI.
  2. In the command line, type the following: orka3 imagecache list

In the example screen above, the information returned displays one image that is 17G and is on one node.


Cached Image State

To display the state or caching status of any image across nodes, follow these steps:

  1. Open the CLI.
    1. In the command line, type the following: orka3 imagecache info <image name>

In the example screen above, the information returned displays more information about the image. For example, the state is Ready and the node that it is cached on is also displayed.


Add a Cached Image to a Node

To add a cached image to a node, follow these steps:

  1. Open the CLI.
  2. In the command line, type the following information: orka3 imagecache add <image name> --nodes <node name>
  1. While the image is caching, it is possible to run the orka3 imagecache info <image name> command, which displays the cache progress.

In the example screen above, the information returned displays that ghcr.io/macstadium/orka-images/sonoma:latest on node mini-arm-32 is in the process of caching. In other words, it is not complete.

Take Aways

  • Scheduled Caching proactively addresses challenges related to propagating new images across a cluster, allowing customers to more immediately interact with their virtual machines.
  • Cache operations have a noticeable impact on running VMs.
  • The bigger the image, the bigger the impact:
    • Caching small images (16GB) may be unnoticeable in VMs with long-running builds (if a build takes 10 minute, then a cache operation of 1 minute has minimal impact).
    • The more images being cached, the bigger the impact. It will take longer to cache and consume more resources.
  • Caching impact varies, depending on when in the build process a cache operation starts. For example, at the beginning of a build, during the IO intensive operation, or the end of a build. Multiple factors impact timing.

🗒️

MacStadium recommends that customers experiment with image sizes and cache timing, to find the best balance for their operations.

  • Cache duration is also impacted by running VMs. The impact depends on what the VM does. For example, if the VM uses CPU or IO heavily, then the cache operation will take longer.

© 2019-2023 Copyright MacStadium, Inc. – Documentation built with readme.com. Orka is a registered trademark of MacStadium, Inc.