diff options
author | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2016-07-18 14:05:56 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-07-18 14:05:56 +1000 |
commit | 8017a9b06cf5fbe941c71c2418401b3dc34f1ab9 (patch) | |
tree | 38bf8ce25feca4b000fea2dee8a95dd2cacf6548 | |
parent | 46085e52719044d40964a00268c3c010bae4453c (diff) | |
download | mongo-8017a9b06cf5fbe941c71c2418401b3dc34f1ab9.tar.gz |
WT-2731 Finer adjustment for page size with raw compression (#2880)
Avoid the uncompressed clean page image approaching memory_page_max where possible.
-rw-r--r-- | src/reconcile/rec_write.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index a39a9726b5b..ceadeca053b 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -1965,10 +1965,14 @@ __rec_split_init(WT_SESSION_IMPL *session, * additional data because we don't know how well it will compress, and * we don't want to increment our way up to the amount of data needed by * the application to successfully compress to the target page size. + * Ideally accumulate data several times the page size without + * approaching the memory page maximum, but at least have data worth + * one page. */ r->page_size = r->page_size_orig = max; if (r->raw_compression) - r->page_size *= 10; + r->page_size = WT_MIN(r->page_size * 10, + WT_MAX(r->page_size, btree->maxmempage / 2)); /* * Ensure the disk image buffer is large enough for the max object, as |