Skip to main content

Service Memory Limits

Overview​

The Appcircle server runs each service in its own container. Each container has two memory settings:

  • Limit: the most memory the service can use. If a service uses more, the kernel stops it and the container restarts automatically. The host and the other services keep running.
  • Reservation: the memory the kernel protects for the service when the host runs low on memory.

The default values below fit most installations. If a service restarts because it reaches its limit, raise the limit of that service first. On Docker, add replicas when the load, such as the number of concurrent users or builds, grows.

info

Per-service memory limits are available in Appcircle server 3.34.5 and later, on both Docker and Podman.

Default Values​

The table shows the default limit and reservation of each container in MiB. Setup containers run once during up and exit when they finish.

ContainerLimit (MiB)Reservation (MiB)
agent_cache640128
api_gateway896128
app_parser9216128
build3456256
codepush896128
distribution2560128
grafana256128
kafka25601024
kafka_zookeeper768128
keycloak1536768
keycloak_migration (setup)1536768
license1024256
loki640256
mcp256128
minio_1 to minio_4 (deprecated multi-node MinIO)3072640
minio_setup (setup)25664
mongo_setup (setup)51264
nginx384128
notification896128
otp256128
postgres384128
publish1152256
redis51264
report896128
resign384128
resource3072128
schedule_service512128
signing_identity896128
sms (when enabled)512128
snsd (MinIO)3072640
store_admin512128
store_api768128
store_profile640128
store_report640128
store_setup (setup, custom store domain only)25664
store_submit512128
store_web640128
task384128
tester_admin640128
tester_api2816128
tester_web640128
vault640128
web_app256128
web_event512128
web_event_redis51264
web_event_redis_replica51264
webhook512128

The limits add up to more than the memory of most hosts. This is expected, because the services do not reach their limits at the same time. Limits are ceilings: memory that the services do not use works as the kernel's file cache, for example for MinIO and MongoDB data, so it is not wasted.

MongoDB is the only part that uses a share of the host memory instead: the MongoDB primary uses up to 25% and each of the 2 secondaries up to 12.5%.

Number of Services​

With the default configuration, the Appcircle server runs 44 containers:

  • 41 containers from the Default Values table, without the setup containers, minio_1 to minio_4, sms and store_setup.
  • 3 MongoDB containers.

The setup containers minio_setup, mongo_setup and keycloak_migration also run during up and exit when they finish. If you use the Enterprise App Store and Testing Distribution in DMZ setup, store_web and tester_web run on the Appcircle DMZ server instead.

Services With Replicas​

On Docker, some services can run more than one replica, that is, more than one copy of the same container. By default, every service runs one replica. On Podman, every service runs one container and the replica count is not used.

The limit and the reservation apply to each replica. A service with 2 replicas can use up to 2 times its limit, and reserves 2 times its reservation.

The services below support replicas on Docker. The second column is the key that sets the replica count in the global.yaml file.

ServiceReplica count key in global.yaml
api_gatewayapiGateway.deploy.replicas
app_parserappParser.deploy.replicas
buildbuild.deploy.replicas
mcpmcpServer.deploy.replicas
notificationnotification.deploy.replicas
resourceresource.deploy.replicas
store_apistoreApi.deploy.replicas
store_webstoreWeb.deploy.replicas
tester_apitesterApi.deploy.replicas
tester_webtesterWeb.deploy.replicas
web_appwebApp.deploy.replicas
web_eventwebEvent.deploy.replicas

To change a replica count, set its key in the global.yaml file, then restart the Appcircle server with the down, export and up commands as shown in Change the Memory of a Service. The example below runs 2 replicas of the build service.

build:
deploy:
replicas: 2
caution

Each extra replica can use as much memory as the limit of the service. Make sure the host has enough memory before you increase a replica count.

Change the Memory of a Service​

caution

Be aware that this process will cause downtime since it requires a restart of the Appcircle server.

  • Log in to the Appcircle server with SSH or a remote connection.

  • Go to the appcircle-server directory.

cd appcircle-server
  • Edit the global.yaml file of your project.
info

The spacetech in the example codes below are example project name.

Please find your own project name and replace spacetech with your project name.

To see projects, you can check the projects directory.

ls -l ./projects
vi ./projects/spacetech/global.yaml
  • Add the service under resources.services and set its limit, its reservation, or both. The example below raises the limit of the build service to 4096 MiB.
resources:
services:
build:
memory:
limit: 4096
reservation: 256

Write the values as whole numbers in MiB, without a unit. The reservation must not be larger than the limit. If a value is not valid, the export command stops with an error that names the service.

Services you do not add keep their default values.

caution

A limit lower than what a service needs makes the service restart repeatedly. Do not set the app_parser limit below its default value.

  • Shutdown Appcircle server.
./ac-self-hosted.sh -n "spacetech" down
  • Apply configuration changes.
./ac-self-hosted.sh -n "spacetech" export
  • Boot Appcircle server.
./ac-self-hosted.sh -n "spacetech" up
tip

You should check the status of the Appcircle server after boot for any possible errors.

./ac-self-hosted.sh -n "spacetech" check

Verify the Limits​

Check the limit and the reservation of a service. The output is in bytes: 4294967296 is 4096 MiB.

docker inspect --format '{{.HostConfig.Memory}} {{.HostConfig.MemoryReservation}}' spacetech-build-1

Below is a sample output for the example above.

4294967296 268435456

To see the current memory usage of every service next to its limit, run the command below.

docker stats --no-stream

Host Memory Check​

The check command warns you when the host has less memory than the containers need. The minimum is the sum of the reservations of the containers your Appcircle server runs plus 4096 MiB for MongoDB and the operating system. On Docker, each replica's reservation is counted.

With the default configuration, the minimum is 12608 MiB. If you raise a reservation or add a replica, the minimum grows by the same amount.

./ac-self-hosted.sh -n "spacetech" check

If you see the warning below, add memory to the host. For the recommended host size, see the server requirements.

WARNING: The host has 7680 MiB of memory, less than the 12608 MiB the services reserve plus MongoDB and the OS. Add memory to the host.

Need help?​

Get help from Appcircle's support team, or see how others are using Appcircle by joining our Slack Channel.

Preview of join.slack.com