# Dynamic resource configuration in Turium

* [Background](#background)
* [Solution](#solution)
  * [Configuring Compute Profile](#configuring-compute-profile)
  * [Configuring Compute Resources](#configuring-compute-resources)

Users might want to create dynamic axons in Turium for improved reusability and simplified operations. This guide explains how to configure compute resources for axon execution at runtime.

***

### Background  <a href="#background" id="background"></a>

Batch Axon can be orchestrated using various engines like MapReduce or Spark. The resources for these engines (CPU and Memory) are typically configured during design time but can be altered during runtime by changing the settings in the Resources tab. Users can also alter the compute profile from the UI.

For dynamic Axons, these resources should be configured via runtime arguments. The following sections show you how to do this.

***

### Solution  <a href="#solution" id="solution"></a>

#### Configuring Compute Profile  <a href="#configuring-compute-profile" id="configuring-compute-profile"></a>

Compute profile can be configured at runtime using the runtime argument (preferences). The value for the profile name should include the scope and profile name separated by a colon 'scope:profileName'.

For instance, to start the axon named 'BQMerge' on a profile called 'dp10' in the system scope:

Configuring Engine Resources Engine resources like CPU (cores) and memory can be configured using runtime arguments (preferences). To configure resources for Spark Driver and Executor, use the following options:

* 'task.driver.system.resources.memory' for configuring the memory for Spark Driver. Memory is set in Megabytes. For instance, setting 'task.driver.system.resources.memory' to 2048 sets the driver memory resources to 2 GB (2048 MB).
* 'task.driver.system.resources.cores' for configuring the CPU (cores) for Spark Driver. By default, the driver CPU is set to 1 core. For instance, setting 'task.driver.system.resources.cores' to 2 sets the driver cores to 2.
* 'task.executor.system.resources.memory' for configuring the memory for Spark Executors. Memory is set in Megabytes. For instance, setting 'task.executor.system.resources.memory' to 2048 sets the executor memory resources to 2 GB (2048 MB).
* 'task.executor.system.resources.cores' for configuring the CPU (cores) for Spark Executors. By default, the driver CPU (cores) is set to 1 core. For instance, setting 'task.executor.system.resources.cores' to 2 configures 2 cores for all executors.

#### Configuring Compute Resources <a href="#configuring-compute-resources" id="configuring-compute-resources"></a>

The following settings are available for configuring compute resources:

* 'system.profile.properties.serviceAccount' for specifying the service account for the cluster.
* 'system.profile.properties.masterNumNodes' for setting the number of master nodes.
* 'system.profile.properties.masterMemoryMB' for setting the memory per master node.
* 'system.profile.properties.masterCPUs' for setting the number of CPUs for the master.
* 'system.profile.properties.masterDiskGB' for setting the disk in GB per master node.
* 'system.profile.properties.workerNumNodes' for setting the number of worker nodes.
* 'system.profile.properties.workerMemoryMB' for setting the memory per worker node.
* 'system.profile.properties.workerCPUs' for setting the number of CPUs per worker node.
* 'system.profile.properties.workerDiskGB' for setting the disk in GB per worker node.
* 'system.profile.properties.stackdriverLoggingEnabled' set to true to enable Stackdriver logging for the Axons.
* 'system.profile.properties.stackdriverMonitoringEnabled' set to true to enable Stackdriver monitoring for the Axons.&#x20;
* 'system.profile.properties.imageVersion' for configuring the image version.
* 'system.profile.properties.network' for configuring the network for the cluster.<br>

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.turium.ai/home/algoreus/turium-connector-documentation/turium-fabriq-overview/how-to-guides/axons-pipeline-user-guide/dynamic-resource-configuration-in-turium.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
