Make page cache level configurable
This commit is contained in:
parent
6cd898b731
commit
57d73fc548
3 changed files with 30 additions and 5 deletions
|
@ -72,7 +72,7 @@
|
||||||
{datatype, integer}
|
{datatype, integer}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
%% @doc The approximate size (in bytes) when a Journal file should be rolled.
|
%% @doc The approximate count of objects when a Journal file should be rolled.
|
||||||
%% This time measured in object count, a file will be rolled if either the
|
%% This time measured in object count, a file will be rolled if either the
|
||||||
%% object count or the journal size limit is reached. Default 200K.
|
%% object count or the journal size limit is reached. Default 200K.
|
||||||
%% Note that on startup an actual maximum size will be chosen which varies by
|
%% Note that on startup an actual maximum size will be chosen which varies by
|
||||||
|
@ -83,6 +83,14 @@
|
||||||
{datatype, integer}
|
{datatype, integer}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
%% @doc The level of the ledger to be pre-loaded into the page cache
|
||||||
|
%% Depending on how much memory is available for the page cache, and how much
|
||||||
|
%% disk I/O activity can be tolerated at startup - then the level at which the
|
||||||
|
%% ledger is forced into the page cache can be controlled by configuration.
|
||||||
|
{mapping, "leveled.ledger_pagecachelevel", "leveled.ledger_pagecachelevel", [
|
||||||
|
{default, 4},
|
||||||
|
{datatype, integer}
|
||||||
|
]}.
|
||||||
|
|
||||||
%% @doc The number of journal compactions per vnode per day
|
%% @doc The number of journal compactions per vnode per day
|
||||||
%% The higher the value, the more compaction runs, and the sooner space is
|
%% The higher the value, the more compaction runs, and the sooner space is
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
{datatype, integer}
|
{datatype, integer}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
%% @doc The approximate size (in bytes) when a Journal file should be rolled.
|
%% @doc The approximate count of objects when a Journal file should be rolled.
|
||||||
%% This time measured in object count, a file will be rolled if either the
|
%% This time measured in object count, a file will be rolled if either the
|
||||||
%% object count or the journal size limit is reached. Default 200K.
|
%% object count or the journal size limit is reached. Default 200K.
|
||||||
%% Note that on startup an actual maximum size will be chosen which varies by
|
%% Note that on startup an actual maximum size will be chosen which varies by
|
||||||
|
@ -77,6 +77,16 @@
|
||||||
{datatype, integer}
|
{datatype, integer}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
%% @doc The level of the ledger to be pre-loaded into the page cache
|
||||||
|
%% Depending on how much memory is available for the page cache, and how much
|
||||||
|
%% disk I/O activity can be tolerated at startup - then the level at which the
|
||||||
|
%% ledger is forced into the page cache can be controlled by configuration.
|
||||||
|
{mapping, "multi_backend.$name.leveled.ledger_pagecachelevel", "riak_kv.multi_backend", [
|
||||||
|
{default, 4},
|
||||||
|
{datatype, integer}
|
||||||
|
]}.
|
||||||
|
|
||||||
|
|
||||||
%% @doc The number of journal compactions per vnode per day
|
%% @doc The number of journal compactions per vnode per day
|
||||||
%% The higher the value, the more compaction runs, and the sooner space is
|
%% The higher the value, the more compaction runs, and the sooner space is
|
||||||
%% recovered. But each run has a cost
|
%% recovered. But each run has a cost
|
||||||
|
|
|
@ -144,6 +144,7 @@
|
||||||
{maxrunlength_compactionpercentage, 70.0},
|
{maxrunlength_compactionpercentage, 70.0},
|
||||||
{reload_strategy, []},
|
{reload_strategy, []},
|
||||||
{max_pencillercachesize, ?MAX_PCL_CACHE_SIZE},
|
{max_pencillercachesize, ?MAX_PCL_CACHE_SIZE},
|
||||||
|
{ledger_preloadpagecache_level, ?SST_PAGECACHELEVEL_LOOKUP},
|
||||||
{compression_method, ?COMPRESSION_METHOD},
|
{compression_method, ?COMPRESSION_METHOD},
|
||||||
{compression_point, ?COMPRESSION_POINT},
|
{compression_point, ?COMPRESSION_POINT},
|
||||||
{log_level, ?LOG_LEVEL},
|
{log_level, ?LOG_LEVEL},
|
||||||
|
@ -320,6 +321,10 @@
|
||||||
% The minimum size 400 - attempt to set this vlaue lower will be
|
% The minimum size 400 - attempt to set this vlaue lower will be
|
||||||
% ignored. As a rule the value should be at least 4 x the Bookie's
|
% ignored. As a rule the value should be at least 4 x the Bookie's
|
||||||
% cache size
|
% cache size
|
||||||
|
{ledger_preloadpagecache_level, pos_integer()} |
|
||||||
|
% To which level of the ledger should the ledger contents be
|
||||||
|
% pre-loaded into the pagecache (using fadvise on creation and
|
||||||
|
% startup)
|
||||||
{compression_method, native|lz4} |
|
{compression_method, native|lz4} |
|
||||||
% Compression method and point allow Leveled to be switched from
|
% Compression method and point allow Leveled to be switched from
|
||||||
% using bif based compression (zlib) to using nif based compression
|
% using bif based compression (zlib) to using nif based compression
|
||||||
|
@ -1184,12 +1189,14 @@ init([Opts]) ->
|
||||||
ok
|
ok
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
PageCacheLevel = proplists:get_value(ledger_preloadpagecache_level, Opts),
|
||||||
|
|
||||||
{HeadOnly, HeadLookup, SSTPageCacheLevel} =
|
{HeadOnly, HeadLookup, SSTPageCacheLevel} =
|
||||||
case proplists:get_value(head_only, Opts) of
|
case proplists:get_value(head_only, Opts) of
|
||||||
false ->
|
false ->
|
||||||
{false, true, ?SST_PAGECACHELEVEL_LOOKUP};
|
{false, true, PageCacheLevel};
|
||||||
with_lookup ->
|
with_lookup ->
|
||||||
{true, true, ?SST_PAGECACHELEVEL_LOOKUP};
|
{true, true, PageCacheLevel};
|
||||||
no_lookup ->
|
no_lookup ->
|
||||||
{true, false, ?SST_PAGECACHELEVEL_NOLOOKUP}
|
{true, false, ?SST_PAGECACHELEVEL_NOLOOKUP}
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue