On Oracle Enterprise Linux 6 (Red Hat Enterprise Linux Server
release 6), Endeca Server has a new option to use cgroups to limit the total
memory usage of Dgraph processes hosted on the machine. Control groups (also
known as cgroups) is a kernel resource-controlling feature of the Linux 6
operating system. They provide a way to define and allocate the system
resources to one or more specific processes, while controlling, at a
high-level, the utilization of these resources, and ensuring that the processes
do not consume excessive resources. In this way, cgroups help avoid situations
where the hosting machines run out of memory for their functioning and are
forced to shut down due to their hosted applications taking over all available
resources on the machine.
For more information on cgroups, see the section on using cgroups in the
Red Hat Enterprise Linux 6 Resource Management Guide,
available from the
Oracle Linux Documentation:
http://linux.oracle.com/documentation/OL6/Red_Hat_Enterprise_Linux-6-Resource_Management_Guide-en-US.pdf.
In the context of the Endeca Server, cgroups can be utilized on the
hosting machines, if the Endeca Server is deployed on Linux 6 and if you enable
cgroups in the Endeca Server. Once you enable cgroups after the installation,
the Endeca Server relies on this mechanism to allocate resources to all data
domains it is hosting. The following statements describe the overall strategy
Endeca Server utilizes to allocate its resources (with and without cgroups).
The limit on memory and threads consumption in the Endeca Server is
enforced with the following methods:
- For both Windows and Linux,
Endeca Server allows data domain creation only if system resources allow it
(this approach is applicable for both Windows and Linux and does not involve
relying in cgroups). By using this strategy, Endeca Server limits the number of
Dgraph processes that can be started on each Endeca Server node based on the
internal calculations on the amount of available memory and processing threads.
Note: For detailed information on the logic behind the Endeca Server
data domain allocation process, see the
Oracle Endeca Server Cluster Guide. The data domain
allocation strategy assumes that you, as an administrator of the Endeca Server
cluster, have made configuration decisions for the types of data domains the
Endeca Server is allowed to host, such as, you have created data domain
profiles that allow auto-idling of data domains, and you have made calculations
for the number of compute threads and the amount of memory to allocate for each
data domain profile you plan to use.
- Additionally, if deployed on
Oracle Linux 6, or Red Had Enterprise Linux 6, Endeca Server limits consumption
of system's resources by the Dgraph processes for each data domain through the
OS-level configuration of cgroups (this assumes that you have enabled cgroups
in the Endeca Server by first adjusting
EndecaServer.properties, and running the
setup_cgroups.sh). When you run the script, Endeca
Server creates and uses a single cgroup for all Dgraph processes hosted on this
machine. Once cgroups are used in the Endeca Server, then even if all of its
resources are used for hosting data domains, cgroups ensure that the machine
hosting the Endeca Server can continue to operate and log messages, and can be
accessed by the system administrator for maintenance, checking its logs, and
troubleshooting. If cgroup is enabled, Endeca Servers uses the cgroup limit of
total virtual memory instead of the total virtual memory of the machine to
allocate data domains.
Note: If cgroups are not used or not enabled (either because you are
not running on Linux 6, or because you didn't enable them), the strategy does
not rely on them.
- Endeca Server further
attempts to shut down unused data domains to make way for active ones, based on
the configuration for auto-idling in the data domain profiles. Endeca Server
only enables a data domain that was previously idle if the calculated amount of
available resources on the Endeca Server node allows it.
Important: If you are planning to deploy a large number of
self-service applications in the Endeca Server, to increase the allocation
guarantees and ensure that Endeca Server nodes continue to operate even when
many data domains are provisioned, you are strongly encouraged to deploy Endeca
Servers on Oracle Linux 6 or RHEL 6, which both allow Endeca Server to utilize
cgroups.