Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entertain the idea of adding gzcompression #17

Open
soulseekah opened this issue Feb 21, 2020 · 7 comments
Open

Entertain the idea of adding gzcompression #17

soulseekah opened this issue Feb 21, 2020 · 7 comments

Comments

@soulseekah
Copy link

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
@msigley
Copy link

msigley commented Feb 21, 2020

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.

@soulseekah
Copy link
Author

soulseekah commented Feb 21, 2020

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.

@msigley
Copy link

msigley commented Feb 22, 2020

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.

@msigley
Copy link

msigley commented Feb 22, 2020

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

@msigley
Copy link

msigley commented Feb 22, 2020

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.

@msigley
Copy link

msigley commented Feb 22, 2020

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.

@soulseekah
Copy link
Author

  1. Benchmarks.

Drastically needed for each and every claim that is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants