Issue
-
There is an issue with the breakdown of document_library storage.
-
In certain cases, document media occupies a larger amount of space, causing the cloud shell to become unresponsive and consume excessive CPU while calculating the size.
-
In certain cases, document media occupies a larger amount of space, causing the cloud shell to become unresponsive and consume excessive CPU while calculating the size.
Environment
- Liferay PaaS
Resolution
-
'Nice' command to run du with a lower priority. The command is:
nice -n 10 du -h <dir_name> 2>/dev/null | grep '[0-9\.]\+G'.
The
-noption allows you to set the niceness value. Niceness values range from -20 (highest priority) to 19 (lowest priority). A higher niceness value means the process will have a lower priority and will get less CPU time compared to processes with lower or default niceness values.
-
Alternatively, the following command can be used to make it less CPU-intensive by limiting the scope of the "du" command to 2 directory levels deep. The following command can also be used here:
du -h --max-depth=2 <dir_name> 2>/dev/null | grep '[0-9\.]\+G'
By using either of the commands above, the size of the document media folder in the cloud shell can be checked.