Configuring Instance Manager

This section describes how to configure the Instance Manager component.

About the Instance Manager component

The Instance Manager (IM) component provides the runtime environment for Apcera containers. Each IM runs on its own node (physical host or virtual machine) in the cluster. In production you will run several IMs. By default job instances will be automatically load balanced across IMs, or you can schedule where jobs run.

When an IM runs a job for the first time, the IM downloads the required packages and stores them locally in its cache. Each IM reserves approximately 50% of its allocated disk space for caching packages locally (and storing job logs).

Starting with Apcera Platform release 2.6.0 you can configure how the IM prunes (removes) packages from its local cache.

Configuring IM Package Cache Pruning

To prune packages from the IM package cache, you must enable it in the chef.continuum.instance_managger.package_manager_lru setting of cluster.conf and deploy the cluster.

Once enabled the IM will check the reservation level (reserved_size_bytes) at the specified interval (prune_interval_seconds) and each time an IM downloads a package. If the package cache size exceeds the reservation threshold, packages will be deleted using a Least Recently Used (LRU) algorithm.

The IM package cache LRU pruning parameters include the following:

Provider Default Description
enabled false Boolean that enables LRU pruning of the IM package cache. By default it is disabled.
prune_interval_seconds 60 Pruning interval in seconds. Note that pruning may also occur each time an IM downloads a package.
reserved_size_bytes 10073741824 Target size of the LRU cache in bytes.

Depending on your requirements you may want to limit when pruning can occur by extending the prune interval to hourly (3600) or daily (86400). Note that pruning may also occur each time an IM downloads a package.

IM package cache pruning example

To enable the IM package cache LRU, add the package_cache_lru parameters to your cluster.conf file and redeploy the cluster. The following example enables IM package cache pruning, sets the pruning interval to 24 hours, and reserves 10GB for the IM package cache size.

chef: {
  "continuum": {
    "instance_manager": {
      "package_cache_lru": {
        "enabled": true,
        "prune_interval_seconds": 86400,
        "reserved_size_bytes": 10073741824