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

Cache: Enable compression by default for values > 1kB #31147

Merged
merged 1 commit into from Nov 14, 2017

Conversation

Projects
None yet
3 participants
@jeremy
Member

jeremy commented Nov 14, 2017

Compression has long been available, but opt-in and at a 16kB threshold.
It wasn't enabled by default due to CPU cost. Today it's cheap and
typical cache data is eminently compressible, such as HTML or JSON
fragments.

Compression dramatically reduces Memcached/Redis mem usage, which means
the same cache servers can store more data, which means higher hit
rates.

To disable compression, pass compress: false to the initializer.

@jeremy jeremy changed the title from Cache: Enable compression by default for values > 1kB. to Cache: Enable compression by default for values > 1kB Nov 14, 2017

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Nov 14, 2017

Member

Looks like you’ve got conflicts.

Idea seems good. Any numbers you can share? This already being used across Basecamp?

Member

schneems commented Nov 14, 2017

Looks like you’ve got conflicts.

Idea seems good. Any numbers you can share? This already being used across Basecamp?

Cache: Enable compression by default for values > 1kB.
Compression has long been available, but opt-in and at a 16kB threshold.
It wasn't enabled by default due to CPU cost. Today it's cheap and
typical cache data is eminently compressible, such as HTML or JSON
fragments.

Compression dramatically reduces Memcached/Redis mem usage, which means
the same cache servers can store more data, which means higher hit
rates.

To disable compression, pass `compress: false` to the initializer.
@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy Nov 14, 2017

Member

Yup, for months now. Great results alongside cache key recycling. Together, these are crucial for a well-behaved Redis cache. Clear highlights: large drop in cache network bandwidth; large increase in # of active cache entries. We will be sharing more along with Rails 5.2 release.

Member

jeremy commented Nov 14, 2017

Yup, for months now. Great results alongside cache key recycling. Together, these are crucial for a well-behaved Redis cache. Clear highlights: large drop in cache network bandwidth; large increase in # of active cache entries. We will be sharing more along with Rails 5.2 release.

@jeremy jeremy added this to the 5.2.0 milestone Nov 14, 2017

@jeremy jeremy merged commit ed10016 into rails:master Nov 14, 2017

2 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jeremy jeremy deleted the jeremy:cache-compression-by-default branch Nov 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment