Liferay Cloud’s auto-scaling feature adjusts the number of Liferay service instances based on demand to maintain performance. Configure the minimum and maximum number of instances to control how the service responds to changes in load.
Setting a minimum addresses sudden changes such as increased server traffic, memory leaks, or other issues.
Setting a maximum prevents Liferay Cloud from creating instances beyond the maximum you’ve configured. This lowers cost, but risks performance issues.
By default, auto-scaling is disabled in every Liferay Cloud account.
Using auto-scaling, a service can increase (upscale) the number of Liferay DXP instances up to a defined maximum, or decrease (downscale) to the number specified in the scale property in LCP.json. The scale property defines the minimum number of additional instances to run:
Auto-scaling is only available for the Liferay DXP service in production environments. Once it’s enabled, each extra instance of the service incurs an hourly charge. This charge is independent of the normal Liferay PaaS subscription process.
At the end of every quarter that you use or deploy additional instances, Liferay sends you an invoice. You must pay this invoice in accordance with your agreement with Liferay.
For each service instance added via auto-scaling, the price depends on your subscription plan. The total charge is based on the number of clock hours that you used the scaled instances. For pricing purposes, the total usage during a calendar quarter is rounded up to the nearest full clock hour.
Follow these steps to enable or disable auto-scaling in the Liferay Cloud Console:
Navigate to the production environment.
Navigate to Services → Liferay → Scale.
Toggle the switch to enable or disable auto-scaling.
Choose the minimum and maximum number of extra instances to be created.
Warning
Deleting and redeploying a service disables auto-scaling if it was previously enabled. However, removing auto-scaling properties from a service’s LCP.json file (such as the scale or autoscale properties) from a service does not disable auto-scaling.
With auto-scaling enabled, Liferay Cloud monitors your service and scales it automatically according to the threshold you define.
For scaling to work properly, it is important to set an appropriate memory allocation for your Liferay image’s JVM. This allocation is necessary to allow the memory usage to expand or contract depending on the server’s load.
Set the liferay service’s LIFERAY_JVM_OPTS environment variable to allocate memory using the -Xms and -Xmx flags. The -Xms flag sets the initial memory allocation when the service starts, while the -Xmx flag determines the maximum memory allocation for the JVM. For example, if you have a total of 16 GB provisioned and available for this service, you can set this configuration:
-Xms4096m -Xmx12288m
The recommended configuration is to set the -Xms flag using 25% of the available memory, and to set the -Xmx flag using 75% of the available memory. Always set your -Xmx value lower than the service’s total available memory to avoid errors when other processes in the container require more memory.
Here are some recommended configurations for different levels of memory available to your liferay service:
Available Memory
Recommended LIFERAY_JVM_OPTS
8 GB
-Xms2048m -Xmx6144m
16 GB
-Xms4096m -Xmx12288m
24 GB
-Xms6144m -Xmx18432m
32 GB
-Xms8192m -Xmx24576m
64 GB
-Xms16384m -Xmx49152m
Note
The LIFERAY_JVM_OPTS variable may appear with other flags, in addition to -Xms and -Xmx. If other flags are present, update the environment variable with the memory arguments without removing the others.
To define the maximum number of additional instances,
Set the LCP_HAPROXY_SERVER_TEMPLATE_BACKEND_NUMenvironment variable in your web server service to the highest total number needed. The liferay service may not scale beyond the maximum number of instances defined in LCP_HAPROXY_SERVER_TEMPLATE_BACKEND_NUM (10 by default). The maximum possible number is 50 instances (1 base instance and 49 additional instances).
On the Liferay service’s Scale tab, update the number in Maximum instances to the desired value.
Note
This field sets the additional number of instances that auto-scaling can create, adding to the base number of instances. It does not set the maximum total number it can create.
Click Update.
Once you have updated both of these configurations, auto-scaling adds additional instances to the liferay service, up to your newly defined maximum.
An activation key is typically required to be deployed and validated to use self-hosted Liferay DXP. On Liferay Cloud when scaling is enabled, the Liferay Cloud team resolves any DXP Activation key issues and adds and removes activation keys as needed.
The Plan and Usage page contains the project’s scaling information. Navigate to the Scaling tab. Under Scaling Summary, you can see
How many environments have extra nodes from scaling
How many hours scaled nodes were up during the selected time period
The associated cost in USD for the nodes
Note
The page only displays scaling events that finished before it loaded. Events that have started but haven’t returned to the normal values don’t appear on the page until they finish.
You can also see a detailed report for the selected time period in Scaling Report.
<p>
This website uses cookies and similar tools, some of which are provided by third parties (together “tools”). These tools enable us and the third parties to access and record certain user-related and activity data and to track your interactions with this website. These tools and the informationcollected are used to operate and secure this website, enhance performance, enable certain website features and functionality, analyze and improve website performance, and personalize user experience.
</p>
<p>
If you click <b>“Accept All”</b>, you allow the deployment of all these tools and collection of the information by us and the third parties for all these purposes.
</p>
<p>
If you click <b>“Decline All”</b> your IP address and other information may still be collected but only by tools (including third party tools) that are necessary to operate, secure and enable default website features and functionalities. Review and change your preferences by clicking the <b>“Configurations”</b> at any time.
</p>
Visit our Privacy Policy