Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79165

Add option to use igbinary for serializing objects in cachestore_file

    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-79165-403
    • MDL-79165-404
    • MDL-79165-main
    • Hide

      As with the Redis cache store, igbinary is only supported when the PHP igbinary module has been installed and enabled... https://www.php.net/manual/en/book.igbinary.php

      After ensuring the above is available, on a fresh Moodle install...

      1. Go to Site administration -> Plugins -> Caching -> Configuration
      2. Add a new File cache store instance
      3. On the "Add File cache store" settings page for this new instance, if the igbinary module is available, the "User serializer" select box will have two available options... "The default PHP serializer." and "The igbinary serializer."
      4. Select "The igbinary serializer." and click the "Save changes" button.
      5. Make the new file cache store instance the default application and session stores.
      6. Create some new courses.
      7. Confirm everything should work as expected with the igbinary option selected.

      Also new unit tests should also cover getting and setting cache items with both the PHP serializer and igbinary.

      Show
      As with the Redis cache store, igbinary is only supported when the PHP igbinary module has been installed and enabled... https://www.php.net/manual/en/book.igbinary.php After ensuring the above is available, on a fresh Moodle install... Go to Site administration -> Plugins -> Caching -> Configuration Add a new File cache store instance On the "Add File cache store" settings page for this new instance, if the igbinary module is available, the "User serializer" select box will have two available options... "The default PHP serializer." and "The igbinary serializer." Select "The igbinary serializer." and click the "Save changes" button. Make the new file cache store instance the default application and session stores. Create some new courses. Confirm everything should work as expected with the igbinary option selected. Also new unit tests should also cover getting and setting cache items with both the PHP serializer and igbinary.
    • 2

      It would be nice to have the option to use igbinary instead of PHP's built in serializer for based cache store instances, this would reduce storage requirements (and potentially bandwidth requirements for remote cache store instances).

      I quickly tested using igbinary for cachestore_file and it seems to make a difference. After using the "Make test course" feature to create a medium sized course, the size of the coursemodinfo cache file for this course was 25kb using PHP's built in serializer, switching to igbinary reduced this to 5kb. It seems to be marginally faster to generate the page but uses a little more ram (8.9mb compared to 8.5mb in my local environment).

            daviesdale Dale Davies
            daviesdale Dale Davies
            Simon Adams Simon Adams
            Votes:
            3 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.