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

Add option to use igbinary for serializing objects in cachestore_file

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE
    • MOODLE_500_STABLE
    • 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.
    • Hide

      Code verified against automated checks with warnings.

      Checked MDL-79165 using repository: https://github.com/daledavies/moodle/

      Should these errors be fixed?

      Built on: Mon 21 Oct 2024 04:55:08 AM UTC

      Show
      Code verified against automated checks with warnings. Checked MDL-79165 using repository: https://github.com/daledavies/moodle/ MOODLE_403_STABLE (0 errors / 1 warnings) [branch: MDL-79165-403 | CI Job ] overview (0/1) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Warn: The MDL-79165 -403 branch at https://github.com/daledavies/moodle/ has not been rebased recently (>20 days ago). MOODLE_404_STABLE (0 errors / 1 warnings) [branch: MDL-79165-404 | CI Job ] overview (0/1) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Warn: The MDL-79165 -404 branch at https://github.com/daledavies/moodle/ has not been rebased recently (>20 days ago). main (0 errors / 1 warnings) [branch: MDL-79165-main | CI Job ] overview (0/1) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Warn: The MDL-79165 -main branch at https://github.com/daledavies/moodle/ has not been rebased recently (>20 days ago). Should these errors be fixed? Built on: Mon 21 Oct 2024 04:55:08 AM UTC
    • 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
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            4 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 43 minutes
                3h 43m

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