pressjitsu/pj-object-cache-red

Entertain the idea of adding gzcompression

Opened this issue · 7 comments

From #13 by @msigley

8028c9d

We've not seen compression being utilized by any Redis object cache implementation out there so far.

Is it really worth it?

  1. Identify pros and cons
  2. Benchmarks
  3. Unit tests

My cache size went down from my max of 800mb to ~300mb after implementing compression. It is also highly recommended to compress your values in large scale redis deployment in the redis docs.
Php has a nice fast zlib deflate implementation that has a very small overhead.

But is it faster? Any change made to this plugin cannot have any performance overhead at all.

Remember the credo: RAM is cheap. CPU cycles are expensive.

If the cache is constantly garbage collecting because it is full its slower. If nothing else this should be an option that can be enabled behind a definition.

The speed before all else makes me question why we are using phps serialize function instead of phpredis's serialization. Php phpredis's serialization is performed and executed in complied c code and will be faster than php serialize

Compression is definitely faster for large keys and helps with the RAM usage across the board. My implementation uses a compression marker with the intention of disabling compression somehow for small values.

Id argue that if you are using a modern version of php such as php fpm or php on windows the cpu use is nothing.

  1. Benchmarks.

Drastically needed for each and every claim that is made.