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

Allow Redis cache to use PHP extension Zstd

XMLWordPrintable

    • MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • MDL-66428_master
    • Hide
      Prerequisite
      1. Install Redis service (daemon) on your Moodle server (see https://docs.moodle.org/37/en/Redis_cache_store#Installing_Redis_server) if you do not already have it.
      2. Install the PHP extension Redis (see https://docs.moodle.org/37/en/Redis_cache_store#Installing_Redis_php_driver) if you do not already have it.
      3. Start the Redis daemon (eg. redis-server /usr/local/etc/redis.conf).
      Test 1
      1. Visit 'Site administration' > 'Plugins' > 'Caching' > 'Configuration'.
      2. Click 'Add instance' next to 'Redis'.
      3. Confirm the options next to Use compressor are 'No compression' and 'Use gzip compression'
      Test 2
      1. Install the PHP extension zstd see https://github.com/kjdev/php-ext-zstd for information on ways to install this by reading the README.
      2. Visit 'Site administration' > 'Plugins' > 'Caching' > 'Configuration'.
      3. Click 'Add instance' next to 'Redis'.
      4. Confirm the options next to Use compressor are 'No compression', 'Use gzip compression' AND 'Zstandard compression'.
      5. Set the 'Store name' and the 'Server' to the address your Redis server is running on (in my case 127.0.0.1) and save.
      6. Visit 'Language string cache' and next to it click 'Edit mappings'
      7. Set the 'Primary store' to the store you created earlier.
      8. Purge the caches.
      9. Confirm browsing still works.
      Test 3.
      1. Add the following to your config.php file define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1');
      2. Run the unit tests vendor/bin/phpunit cache/stores/redis/tests/compressor_test.php.
      Show
      Prerequisite Install Redis service (daemon) on your Moodle server (see https://docs.moodle.org/37/en/Redis_cache_store#Installing_Redis_server ) if you do not already have it. Install the PHP extension Redis (see https://docs.moodle.org/37/en/Redis_cache_store#Installing_Redis_php_driver ) if you do not already have it. Start the Redis daemon (eg. redis-server /usr/local/etc/redis.conf ). Test 1 Visit 'Site administration' > 'Plugins' > 'Caching' > 'Configuration'. Click 'Add instance' next to 'Redis'. Confirm the options next to Use compressor are 'No compression' and 'Use gzip compression' Test 2 Install the PHP extension zstd see https://github.com/kjdev/php-ext-zstd for information on ways to install this by reading the README. Visit 'Site administration' > 'Plugins' > 'Caching' > 'Configuration'. Click 'Add instance' next to 'Redis'. Confirm the options next to Use compressor are 'No compression', 'Use gzip compression' AND 'Zstandard compression'. Set the 'Store name' and the 'Server' to the address your Redis server is running on (in my case 127.0.0.1) and save. Visit 'Language string cache' and next to it click 'Edit mappings' Set the 'Primary store' to the store you created earlier. Purge the caches. Confirm browsing still works. Test 3. Add the following to your config.php file define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1'); Run the unit tests vendor/bin/phpunit cache/stores/redis/tests/compressor_test.php .

      Zstandard is a relatively new compression algorithm that has been open sourced by Facebook.

      See this article.

      Zstd promises both better compression and faster compression than the gzip.

      Php extension is available here https://github.com/kjdev/php-ext-zstd

      Task here is to extend the Redis Cache plugin to make it capable of detecting that Zstd is available and offering that as a compression choice when configuring MUC.

            markn Mark Nelson
            markn Mark Nelson
            Carlos Escobedo Carlos Escobedo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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