Resource optimization

Resource usage

To run a UI Bakery instance, it's recommended to have at least 2 CPUs and 4 GiB of memory. For handling hundreds or thousands of simultaneous user sessions, or gigabytes of data in automation, you may need to increase these resources. It's challenging to specify the exact resource requirements, so we recommend monitoring resource usage and adjusting based on demand.

When you deploy UI Bakery using Docker Compose, each UI Bakery service will consume resources on demand. You may want to adjust resource limits for various UI Bakery services based on your specific needs. If you expect that users might trigger heavy queries leading to overuse of resources, set hard limits in the docker-compose.yml file, for example:

 datasource:
    container_name: datasource
    image: cruibakeryonprem.azurecr.io/cloud/datasource:${UI_BAKERY_VERSION:-latest}
    restart: always
    env_file: .env
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 1024M

The configuration above limits the datasource service to consuming more than 1 CPU and 1 GiB of memory.

We recommend setting resource limits for the datasource, automation, and python-runtime services if you experience unpredictable loads on these services. The memory limit should be at least twice the size of the processed data.

Replicating UI Bakery services

To accommodate numerous concurrent data sources or automation requests, you may choose to scale some of UI Bakery's services by adjusting the docker-compose.yml file with the replicas config:

  datasource:
    container_name: datasource
    image: cruibakeryonprem.azurecr.io/cloud/datasource:${UI_BAKERY_VERSION:-latest}
    restart: always
    env_file: .env
    deploy:
      mode: replicated
      replicas: 4

Scaling is advisable for these services: datasource, automation, and python-runtime. However, replicating the bakery-back service is not recommended. Other UI Bakery services, such as bakery-gateway, bakery-front, and workbench-front can handle heavy loads efficiently while maintaining low resource usage.

Last updated

© 2024 UI Bakery