Configuring Auto-scaling
Once you’ve enabled production environment clustering with any number of nodes, you can configure auto-scaling to better handle site traffic during peak hours.
Help Marcus configure auto-scaling by following these steps.
You are billed quarterly based on the usage of instances automatically added from auto-scaling. Contact your Liferay account manager for details on the rates for these additional instances.
Enable Auto-scaling in the Console
Use the Liferay Cloud console to enable auto-scaling for your production environment.
-
In the Liferay Cloud console, navigate to your production environment.
-
Navigate to Services → Liferay.
-
Select the Scale tab.
-
Click Enable Auto Scaling.
Auto-scaling is now enabled. You have a minimum of two nodes because of your clustering configuration, and if usage increases, more nodes are added up to the default maximum of ten.
Set the Maximum Number of Instances
Several iterations at peak hours reveal that Delectable Bonsai’s website requires more than the default 10 Liferay instances. Help Marcus reconfigure the auto-scale maximum from 10 to 12.
Set the maximum number of instances via the maxInstances
property in your Liferay service’s LCP.json
file:
-
In your project repository, navigate to the
liferay/
directory and open theLCP.json
file. -
Set the
maxInstances
value to 12, within theautoscale
JSON object:"autoscale": { "maxInstances": 12 }
-
Commit and push the changes in your Git repository.
git add liferay/LCP.json
git commit -m "Increase the maximum number of instances to 12."
git push origin [branch_name]
Your repository on GitHub now has the updated number of maximum instances, and Liferay Cloud creates a new build with your changes.
Deploy the Configuration
Deploy the updated configuration to your production environment.
-
Log into the Liferay Cloud console.
-
Click the Builds link at the top-right of the screen to access the Builds page.
-
Click the Actions menu for the build corresponding to the commit with your new changes, and select Deploy build to…
-
Select your production environment in the Environment drop-down menu.
-
Check the boxes acknowledging the impacts of the deployment.
-
Click Deploy Build.
Once your services restart, auto-scaling is enabled, up to a maximum of 12 instances.
Next: change the password for your database service.