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.

In Apcera Platform release 3.2.0, it is possible to configure ongoing TCP health checks on job instances with exposed non-optional ports. You can configure the time between polls, which is by default set to 30 seconds. The TCP health check is done to ensure that a TCP service container is working as expected during its lifetime. If the TCP service in the container fails, the instances are killed and restarted.

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
      }
    }
  }
}

Configuring TCP liveness probe

To configure the TCP health checks on exposed non-optional ports, add the containers parameters to your cluster.conf file.

This enables the IM to run ongoing connection testing on exposed non-optional TCP ports.

The variable (tcp_liveness_probe_interval) is used to set the time between polls (in seconds). The default value for this parameter is 30 seconds. In the example below the poll will be every 15 seconds.

chef: {
  "continuum": {
    "instance_manager": {
      "containers": {
        "tcp_liveness_probe_interval": "15"
       },
       "keep_logs": true,
       "container_dns_ip": ["8.8.8.8", "8.8.4.4"],
       "log": {
	 "level": "all"
	}
    }
  }
}