Memory usage varies depending on whether or not the CloudBees Flow server is a dedicated machine.
-
a CloudBees Flow server running on a dedicated machine has a default minimum heap memory allocation of 20% and a maximum heap memory allocation of 40%. This applies to either a 32 or 64-bit system.
-
In general, a CloudBees Flow agent has a default minimum memory usage of 16 MB and a maximum memory usage of 64 MB. However, agents for REPO-server, Web-Server and Proxy agents needing higher settings; for details, see the KBEC-00248 - Agent Memory Configuration Knowledge Base article.
Modifying Memory Settings for a CloudBees Flow Server
There are two ways you can adjust the amount of memory for the CloudBees Flow server.
-
Modify the
wrapper.java.initmemory.percent
andwrapper.java.maxmemory.percent
lines inwrapper.conf
Use the following table to determine the correct directory path.
Server Type | System | Path |
---|---|---|
Non-repository |
Windows 2008 |
|
Windows 7 |
||
Linux |
|
|
Repository |
Windows 2008 |
|
Windows 7 |
||
Linux |
|
-
Use
ecconfigure
to set the initial and maximum memory settings.For example, to set the CloudBees Flow Server initial memory percentage to 21% and the maximum memory percentage to 31%, enter the following command:
ecconfigure --serverInitMemory 21 --serverMaxMemory 31
Modifying Memory Settings for a CloudBees Flow Agent
To adjust the amount of memory for the CloudBees Flow agent, modify the wrapper.java.initmemory.percent
and wrapper.java.maxmemory.percent
lines in wrapper.conf for the agent. Use the appropriate directory path:
-
Windows:
C:\ProgramData\Electric Cloud\ElectricCommander\conf\agent\wrapper.conf
-
Linux:
/opt/electriccloud/electriccommander/conf/agent/wrapper.conf
Modifying Memory Settings for a Containerized Servers
By default, the initial memory and maximum memory for the CloudBees Flow server and repository server JVMs are configured as percentages of the total system memory. However, if these servers are running in a container, their JVMs cannot see the container’s total system memory.
To fix this problem, you can either:
-
Make the JVM aware that it is running in a docker container and observe the container memory limits.
-
Modify the settings in the
/opt/electriccloud/electriccommander/conf/wrapper.conf
file for the CloudBees Flow server and CloudBees Flow repository server to use absolute values (in MB) instead of using thewrapper.java.initmemory.percent
andwrapper.java.maxmemory.percent
settings.
Docker Container Memory Limits
As of Java SE 8u131, and in JDK 9, you can transparently set a maximum Java heap for Docker memory limits. To make the JVM aware of these limits if you do not set a maximum Java heap via -Xmx
, you must use two experimental JVM command line options:
-XX:+UnlockExperimentalVMOptions
-XX:+UseCGroupMemoryLimitForHeap
Configuring Memory Settings for a Containerized Servers
To configure the CloudBees Flow server and repository server Java processes to use absolute values:
-
Open a Bash session in the container by entering:
docker exec -it <container_name> bash
where
<container_name>
is the name of your CloudBees Flow server or repository server container. For example, enter:docker exec -it efserver bash
-
Enter the following command:
ecconfigure --serverInitMemoryMB=<megabytes> --serverMaxMemoryMB=<megabytes>
or
ecconfigure --repositoryInitMemoryMB=<megabytes> --repositoryMaxMemoryMB=<megabytes>
For example, enter:
ecconfigure --serverInitMemoryMB=4096 --serverMaxMemoryMB=6144
or
ecconfigure --repositoryInitMemoryMB=512 --repositoryMaxMemoryMB=1024
Select the maximum values based on your usage requirements. The server service restarts and begins using the new settings.
For information about using ecconfigure
, see CloudBees Flow Installed Tools.