Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-115849

Reduce number of directories created in AM

    Details

      Description

      Currently [AM creates too many directories|https://github.com/liferay/liferay-portal/blob/master/modules/apps/adaptive-media/adaptive-media-image-service/src/main/java/com/liferay/adaptive/media/image/internal/storage/AMStoreUtil.java] to store images adapted to the configured resolutions. Folders hierarchy follows the next pattern:

      adaptive -> configurationUuid -> groupId -> repositoryId -> fileEntryId -> fileVersionId

       

      For example, for Liferay's default thumbnails resolution, and an image with two versions, AM creates

      adaptive\Thumbnail-300x300\20124\20124\36542\36558\1.0

      and

      adaptive\Thumbnail-300x300\20124\20124\36542\36543\1.0

      folders, which makes a total of 9 folders/files. Which leads to file systems quickly reach their physical limits in number of used inodes (pointers to folders/files) because this number could grow exponentially depending on the number of resolutions configured and versions of each file.

       

      After doing some analysis with Lima team in PTR-1760, we got to the conclusion that the following hierarchy would also make sense and would save a lot of physical resources consumed by AM:

      adaptive-> configurationUuid -> fileVersionId

      which, in our example will look like:

      adaptive\Thumbnail-300x300\36542\36558\1.0

      and

      adaptive\Thumbnail-300x300\36542\36543\1.0

      making a total of 7 folders/files created, and saving in this case almost a 5% of inodes, which can be very beneficial for customers.

       

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            cristina.rodriguez Cristina Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package