diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-04-18 16:17:15 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-04-18 16:17:15 +1000 |
commit | 2e074b975e248081abcb74a540e687f3fc5e7364 (patch) | |
tree | f6ed6e2e6208c486a7cf1922dafb31feaca9301b /ext | |
parent | 68c5dc70e1e94108241fec33bc23ceca3978a7cc (diff) | |
download | mongo-2e074b975e248081abcb74a540e687f3fc5e7364.tar.gz |
WT-2548 Cap the amount of data handed to raw compression.
Previously, we had special case code for zlib to bound the compression
ratio to an arbitrary factor. This is driven by synthetic workloads
where data can be compressed on disk to 1% or less of the in-memory
size. If WiredTiger allows such on-disk pages to grow, they can end up
larger than the maximum page size permitted in memory and either
immediately force eviction or in extreme cases grow larger than the
total cache size.
This change bounds the amount of data handed to raw compression based on
the maximum page size in memory before attempting in-memory splits.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/compressors/zlib/zlib_compress.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/compressors/zlib/zlib_compress.c b/ext/compressors/zlib/zlib_compress.c index 4ff0d8576eb..9aede2ed907 100644 --- a/ext/compressors/zlib/zlib_compress.c +++ b/ext/compressors/zlib/zlib_compress.c @@ -307,17 +307,9 @@ zlib_compress_raw(WT_COMPRESSOR *compressor, WT_SESSION *session, /* * If there's more compression to do, save a snapshot and keep * going, otherwise, use the current compression. - * - * Don't let the compression ratio become insanely good (which - * can happen with synthetic workloads). Once we hit a limit, - * stop so the in-memory size of pages isn't hugely larger than - * the on-disk size, otherwise we can get into trouble where - * every update to a page results in forced eviction based on - * the in-memory size, even though the data fits into a single - * on-disk block. */ last_slot = curr_slot; - if (zs.avail_out > 0 && zs.total_in <= zs.total_out * 20) { + if (zs.avail_out > 0) { if ((ret = deflateCopy(&last_zs, &zs)) != Z_OK) return (zlib_error( compressor, session, "deflateCopy", ret)); |