Join the community today
Register Now

Compression method for redis caching ?

Discussion in 'System Administration' started by negative, Sep 24, 2019.

  1. negative

    negative Active Member

    346
    39
    28
    Apr 11, 2015
    Ratings:
    +81
    Local Time:
    6:18 AM
    1.9.10
    10.1.11
    Hello,

    We're currently using the Redis caching (backend + guest page + css ) on xenforo 2.1.4 and compression enabled with gzip.

    However, i see that lz4 compression has more advantages than gzip generally but what about in redis?

    Anyone have experience for that? Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,720
    9,390
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,424
    Local Time:
    1:18 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Just stick with gzip :)
     
  3. JJC84

    JJC84 Premium Member Premium Member

    235
    100
    28
    Jan 31, 2018
    Ratings:
    +156
    Local Time:
    10:18 PM
    1.15.x
    10.1.x
    Max compression gzip or brotli server-side to Redis will definitely reduce your bill however max compression will probably not work to minimize latency. There are a lot of things which can be done to make more efficient use of Redis. Refer to this slide presentation.

    RedisConf18 - Redis Memory Optimization
     
    • Informative Informative x 1
  4. negative

    negative Active Member

    346
    39
    28
    Apr 11, 2015
    Ratings:
    +81
    Local Time:
    6:18 AM
    1.9.10
    10.1.11
    I though ideal choice is gzip #1 (comp level) then. (especially for xenforo forum caching)
     
  5. JJC84

    JJC84 Premium Member Premium Member

    235
    100
    28
    Jan 31, 2018
    Ratings:
    +156
    Local Time:
    10:18 PM
    1.15.x
    10.1.x
    There are very good arguments for implementing compression but the more highly compressed the data the more latency will be added for the overhead of processing. It may be more beneficial to use a different form of storage if you are generating too much in-memory data due to cost limitations. Or it may be wiser to look at how you can optimize your code as well as your Redis schema to minimize the amount of data that must be stored in memory. It isn't possible for me to say but I also don't think that using gzip level 1 is going to tank anyone's product either.