In this page you’ll learn how Ergomake handles resource limits within an environment, and how to make better use of the resources available to your preview environments.

Managing memory quotas

Every Ergomake environment has a memory quota it can use.

To see what are the memory quotas for the free and paid tiers, see our pricing page.

By default, if you don’t determine how much memory each docker-compose.yml service needs, Ergomake will split the memory equally between services.

For example, if you have two services and your environment size-limit is one Gi, each service will get 512 Mi.

If the terms GiB and MiB sound confusing, see this page.

To manually split resources across services, you’ll have to use the resources attribute within your docker-compose.yml.

Imagine, for example, that you want to allow your back-end to consume 896 MiB of memory, and you want your front-end to consume the remaining 128 MiB.

In that case, you’d write the following docker-compose.yml file.

version: '3.8'
services:
   frontend:
     build:
       context: ./frontend
     ports:
       - "8080:8080"
     resources:
       limits:
         memory: 128Mi

  backend:
    build: ./backend
    ports:
      - '3001:3001'
     resources:
       limits:
         memory: 896Mi

Environments whose limits surpass your tier’s limit will not run.