Want to subscribe to topics you're interested in?
Become a Member

Compression method for redis caching ?

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

  1. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    5:13 PM
    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

    53,142
    12,108
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,643
    Local Time:
    12:13 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Just stick with gzip :)
     
  3. JJC84

    JJC84 Ad astra per aspera

    247
    109
    43
    Jan 31, 2018
    San Antonio, Texas
    Ratings:
    +169
    Local Time:
    9:13 AM
    1.15.x
    10.x.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
     
  4. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    5:13 PM
    1.9.10
    10.1.11
    I though ideal choice is gzip #1 (comp level) then. (especially for xenforo forum caching)
     
  5. JJC84

    JJC84 Ad astra per aspera

    247
    109
    43
    Jan 31, 2018
    San Antonio, Texas
    Ratings:
    +169
    Local Time:
    9:13 AM
    1.15.x
    10.x.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.