C3 AI Documentation Home

Use Spot Instances to Reduce Cost of Resources in Cluster

As a Cluster Administrator, using spot virtual machines (VMs or Spot VMs) can help reduce the cost of running the C3 Agentic AI Platform in a cloud deployment.

Requirement

A cloud provider Operator must enable spot instances before you can configure the HardwareAvailability for node pools in the C3 AI cluster.

Hardware availability modes

Configure HardwareAvailability on App.NodePool to consume spot instances based on your preference:

  • LOW - Node pools use only spot instances. If those types of nodes are not available, there might be limited-to-zero capacity.

  • BALANCED - Node pools use spot instances. If they are not available due to capacity issues in the cloud provider, then the node pools run on on-demand VMs.

  • HIGH - (Default) Node pools use only on-demand VMs through the Cloud Provider.

Refer to the HardwareAvailability Type for more information about the above fields.

Use cases for each hardware availability mode

The following table lists possible use cases and examples for each hardware availability mode:

Hardware availability modeUse caseExample
LOWNon-critical workloads, such as data integration, data science, or batch processing, that can tolerate interruptions.Use spot instances to run a batch job to process large amounts of data. Since interruptions are tolerable and you can resume jobs later, use the LOW mode to take advantage of the cost savings of spot instances.
BALANCEDCritical workloads, such as real-time analytics or machine learning, that must minimize interruptions, but can tolerate some downtime.Use spot instances to run a real-time analytics application. The application requires high availability, but tolerates some downtime during periods of low usage. BALANCED mode ensures that the application is available most of the time, while still taking advantage of the cost savings of spot instances.
HIGHMission-critical workloads, such as transactional databases or high-frequency trading, that cannot tolerate interruptions. Use on-demand VMs, not spot instances to run your workloads.Use on-demand VMs to run a transactional database. Because the database requires high availability and cannot tolerate interruptions, use the HIGH mode to ensure that the database is highly available.

Examples

The following example code snippet demonstrates how to create a HardwareProfile for a spot instance using LOW, which specifies that only spot instances are used if available.

JavaScript
HardwareProfile
  .builder()
  .name("spot")
  .cpu(8)
  .memoryMb(32000)
  .hardwareAvailability(HardwareAvailability.LOW)
  .jvmMaxMemoryPct(0.7)
  .jvmMinMemoryPct(0.7)
  .build()
  .setConfig();

C3.app().configureNodePool('spottasknodes', 10, 0, 10, HardwareProfile.forName("spot"), [Server.Role.TASK], false)

The following example code snippet demonstrates how to create a HardwareProfile for a balanced BALANCED use of spot instances, which specifies that spot instances are preferred but standard computer engine VMs will be used if no spot instances are available.

JavaScript
HardwareProfile
  .builder()
  .name("balanced")
  .cpu(8)
  .memoryMb(32000)
  .hardwareAvailability(HardwareAvailability.BALANCED)
  .jvmMaxMemoryPct(0.7)
  .jvmMinMemoryPct(0.7)
  .build()
  .setConfig();

C3.app().configureNodePool('balancedtasknodes', 10, 0, 10, HardwareProfile.forName("balanced"), [Server.Role.TASK], false)

See also

Was this page helpful?