Issue
-
Since we allowed access to some users to contribute content, we are getting many issues with Liferay service restarts.
-
While we are working with the platform, following error message is shown without any apparent reason: 'An error occurred with this application'.
-
when we check the logs we can see Liferay service is restarting.
-
System workload generated by users does not seem too much high since they are only 11 users.
-
Why is happening this instability in the system?
Environment
- Liferay DXP PaaS
- PaaS environment Liferay service has reserved
8 GB RAM
. - Minimum and maximum heap JVM parameters
'-Xms'
and'-Xmx'
are not equal. - Maximum heap JVM parameter
'-Xmx'
is set to6 GB
. - Monitoring graphs shows requested memory is greater than
6 GB
.
Resolution
-
Within Liferay PaaS, each of the services are setup and run within a container. And each of these containers are managed by a Kubernetes system in the cloud. Within each of the containers, 'memory' is composed of several different segments. The memory within the container is the sum of all the memory values that make up these segments. If we give too much memory to the segments which make up the service, it can lead to the service’s container to run out of memory and result in restarts (or even not starting).
-
Our metrics drive to us to recommend not to give more than
60%
of service's memory to the JVM's heap. In this case:60% of 8 GB = 5 GB.
- Also, another recommendation would be to set the
'-Xms'
and'-Xmx'
parameters to the same value so memory will not fluctuate as much. - Thus, to fix the issue, there would be to increase Liferay service memory until
60%
JVM's heap would get> 6 GB
.- To achieve this, you may need to lower memory in other services, for example Elasticsearch one.
- And following the case, Liferay service would need to reserve
12 GB
and JVM's heap would be configured with'-Xms7300m -Xmx7300m'
Additional Information