Configure UI Bundler batch size
By default, C3 AI Platform is configured to ensure a balance between speed and resource consumption. This design decision spans to all parts of C3 AI Platform, including UI bundler.
In combination with the rest of your deployment, you can configure UI bundler to:
- Be faster, by starting more UI bundling tasks, therefore consuming more memory and compute resources.
- Save memory and compute resources, therefore taking longer to bundle your UI. This document explains the different configurations available to you, so you can optimize C3 AI Platform to your needs. You can experiment with different configurations to determine the optimal settings for your situation.
The UI Bundler generates webpack configurations which are separate modules of code that can be bundled individually. This approach allows developers to pick and choose how many webpack configurations to bundle per BatchJob. This is useful when you want to control how quickly you want UI Bundler to run. If you increase the number of webpack configurations to bundle in one Job, bundling will be faster, but may come at the cost of stability as the BatchJob may run out of memory.
Overview
When bundling the UI of your application, C3 AI Platform creates different Webpack modules, allowing these modules to be bundled individually. The number of modules is configurable, allowing administrators to configure how many modules to process for each UI bundling batch job.
This is useful when you want to control how quickly you want UI bundler to run. If you increase the number of webpack modules to bundle in one UI bundler batch job, bundling will be faster, but that will use more memory and compute resources on your nodes. If your nodes are not appropriately sized, the node my run out of memory, leading that UI bundler job to fail.
Configurations available
There are two types of modes that you can bundle in - production and development mode. We provide configurations on UiBundlerConfig#productionBatchSize and UiBundlerConfig#developmentBatchSize that allow you to specify how many webpack configurations to bundle in one BatchJob for production or development mode.
productionBatchSize: This configuration determines the number of webpack configurations to bundle per batch job in production mode. Given the large amount of code in production mode, we recommend not changing the default setting, which bundles one federated module per batch job. Increasing this number may lead to memory issues as the node may run out of memory while trying to bundle too much code in one batch job.
developmentBatchSize: This configuration allows you to choose how many webpack configurations to bundle per batch job in development mode. Increasing the number of webpack configurations per batch job can speed up the bundling process but may also lead to memory issues if too many webpack configurations are bundled at once. Conversely, decreasing the number of webpack configurations per batch job can make the bundling process slower but more stable, as there is less code to bundle. Because there is signficiantly less code bundled in development compared to production mode, this value can be modified according to your application's need.
Depending on the amount of code and the application being bundled, we recommend testing different configurations for batch size to determine the optimal settings for your application. This approach allows you to balance bundling speed and stability according to your needs.
You're reading the C3 AI UI Developer Guide. The full Table of Contents is here.