Recommended Memory Allocation for Proxy
What is the recommended memory allocation for Security Server's proxy component with respect to the host's available memory?
The recommended memory allocation for proxy depends on the amount of RAM available on the host. In addition, also the type of host (virtual, physical etc.) and usage patterns of the Security Server effect on the most optimal amount of memory. The table below shows general recommendations regarding the amount of memory allocated for the proxy component.
RAM on host (GB) | PROXY_PARAMS value |
|---|---|
4 | -Xms200m -Xmx512m |
8 | -Xms512m -Xmx2g |
16 | -Xms2g -Xmx8g |
31 | -Xms2g -Xmx16g |
The default memory allocation for proxy is only -Xms100m -Xmx512m. In production environments the allocation should be increased.
Please note that the step-by-step guides differ between X-Road 6 and X-Road 7. Therefore, it's extremely important to choose the right guide.
More information about the differences is available here.
Step-by-step guide for X-Road 7
Memory allocation for proxy can be customized modifying /etc/xroad/services/local.properties configuration file
Proxy's default configuration is stored in /etc/xroad/services/proxy.conf which is always overwritten on version updates. Therefore, /etc/xroad/services/local.properties must be used for overriding default configuration as the file is not overwritten during version updates. By default, /etc/xroad/services/local.properties file is empty.
Open
/etc/xroad/services/local.propertiesfile for editing and make your changes onXROAD_PROXY_PARAMSvariable value. For example, configuration of dynamic memory allocation of 200 - 2000 MB (heap, max memory 2000 MB, min memory 200 MB):XROAD_PROXY_PARAMS=-Xms200m -Xmx2000mThe size of the metaspace can be adjusted changing the value of
MaxMetaspaceSizeparameter. The value can be increased to 160m (-XX:MaxMetaspaceSize=160m), if needed.Save the
/etc/xroad/services/local.propertiesfile after making the required changes.Restart the
xroad-proxyservice.systemctl restart xroad-proxy
Step-by-step guide for X-Road 6
Memory allocation for proxy can be customized modifying /etc/xroad/services/local.conf configuration file
Proxy's default configuration is stored in /etc/xroad/services/proxy.conf which is always overwritten on version updates. Therefore, /etc/xroad/services/local.conf must be used for overriding default configuration as the file is not overwritten during version updates. By default /etc/xroad/services/local.conf file is empty.
Open
/etc/xroad/services/local.conffile for editing and make your changes onPROXY_PARAMSvariable value. For example, configuration of dynamic memory allocation of 200 - 2000 MB (heap, max memory 2000 MB, min memory 200 MB):PROXY_PARAMS="$PROXY_PARAMS -Xms200m -Xmx2000m "The size of the metaspace can be adjusted changing the value of
MaxMetaspaceSizeparameter. The value can be increased to 160m (-XX:MaxMetaspaceSize=160m), if needed.
It is extremely important that the parameters defined in proxy.conf are not lost and therefore, the overriding memory parameters are added to the default PROXY_PARAMS.
Save the
/etc/xroad/services/local.conffile after making the required changes.Restart the
xroad-proxyservice.# Ubuntu service xroad-proxy restart # RHEL systemctl restart xroad-proxy