Merge remote-tracking branch 'origin/master' into gsb-atomic-ops
This commit is contained in:
parent
aedb91aca5
commit
72448d2b54
3 changed files with 25 additions and 21 deletions
|
@ -337,11 +337,9 @@ async_nif_enqueue_req(struct async_nif_state* async_nif, struct async_nif_req_en
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the for loop finished then we didn't find a suitable queue for this
|
/* If the for loop finished then we didn't find a suitable queue for this
|
||||||
request, meaning we're backed up so trigger eagain. */
|
request, meaning we're backed up so trigger eagain. Note that if we left
|
||||||
if (i == async_nif->num_queues) {
|
the loop in this way we hold no lock. */
|
||||||
enif_mutex_unlock(q->reqs_mutex);
|
if (i == async_nif->num_queues) return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add the request to the queue. */
|
/* Add the request to the queue. */
|
||||||
STAILQ_INSERT_TAIL(&q->reqs, req, entries);
|
STAILQ_INSERT_TAIL(&q->reqs, req, entries);
|
||||||
|
@ -349,7 +347,7 @@ async_nif_enqueue_req(struct async_nif_state* async_nif, struct async_nif_req_en
|
||||||
|
|
||||||
/* We've selected a queue for this new request now check to make sure there are
|
/* We've selected a queue for this new request now check to make sure there are
|
||||||
enough workers actively processing requests on this queue. */
|
enough workers actively processing requests on this queue. */
|
||||||
if (q->depth > q->num_workers)
|
if (q->depth > q->num_workers || q->num_workers == 0)
|
||||||
if (async_nif_start_worker(async_nif, q) == 0) q->num_workers++;
|
if (async_nif_start_worker(async_nif, q) == 0) q->num_workers++;
|
||||||
|
|
||||||
/* Build the term before releasing the lock so as not to race on the use of
|
/* Build the term before releasing the lock so as not to race on the use of
|
||||||
|
|
|
@ -12,7 +12,7 @@ set -e
|
||||||
|
|
||||||
WT_REPO=http://github.com/wiredtiger/wiredtiger.git
|
WT_REPO=http://github.com/wiredtiger/wiredtiger.git
|
||||||
WT_BRANCH=
|
WT_BRANCH=
|
||||||
WT_REF="tags/1.6.2"
|
WT_REF="tags/1.6.3"
|
||||||
WT_DIR=wiredtiger-`basename $WT_REF`
|
WT_DIR=wiredtiger-`basename $WT_REF`
|
||||||
|
|
||||||
SNAPPY_VSN="1.0.4"
|
SNAPPY_VSN="1.0.4"
|
||||||
|
|
|
@ -118,14 +118,14 @@ start(Partition, Config) ->
|
||||||
case Type of
|
case Type of
|
||||||
"lsm" ->
|
"lsm" ->
|
||||||
[{internal_page_max, "128K"},
|
[{internal_page_max, "128K"},
|
||||||
{leaf_page_max, "128K"},
|
{leaf_page_max, "16K"},
|
||||||
{lsm_chunk_size, "100MB"},
|
{lsm_chunk_size, "100MB"},
|
||||||
{lsm_merge_threads, 2},
|
{lsm_merge_threads, 2},
|
||||||
{prefix_compression, false},
|
{prefix_compression, true},
|
||||||
{lsm_bloom_newest, true},
|
{lsm_bloom_newest, true},
|
||||||
{lsm_bloom_oldest, true} ,
|
{lsm_bloom_oldest, true} ,
|
||||||
{lsm_bloom_bit_count, 128},
|
{lsm_bloom_bit_count, 28},
|
||||||
{lsm_bloom_hash_count, 64},
|
{lsm_bloom_hash_count, 19},
|
||||||
{lsm_bloom_config, [{leaf_page_max, "8MB"}]}
|
{lsm_bloom_config, [{leaf_page_max, "8MB"}]}
|
||||||
] ++ Compressor;
|
] ++ Compressor;
|
||||||
"table" ->
|
"table" ->
|
||||||
|
@ -375,10 +375,17 @@ max_sessions(Config) ->
|
||||||
undefined -> 1024;
|
undefined -> 1024;
|
||||||
Size -> Size
|
Size -> Size
|
||||||
end,
|
end,
|
||||||
Est = 100 * (RingSize * erlang:system_info(schedulers)), % TODO: review/fix this logic
|
Est = RingSize * erlang:system_info(schedulers),
|
||||||
case Est > 1000000000 of % Note: WiredTiger uses a signed int for this
|
case Est > 8192 of
|
||||||
true -> 1000000000;
|
true ->
|
||||||
false -> Est
|
8192;
|
||||||
|
false ->
|
||||||
|
case Est < 1024 of
|
||||||
|
true ->
|
||||||
|
1024;
|
||||||
|
false ->
|
||||||
|
Est
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
|
@ -406,7 +413,6 @@ establish_connection(Config, Type) ->
|
||||||
[ wterl:config_value(create, Config, true),
|
[ wterl:config_value(create, Config, true),
|
||||||
wterl:config_value(sync, Config, false),
|
wterl:config_value(sync, Config, false),
|
||||||
wterl:config_value(logging, Config, true),
|
wterl:config_value(logging, Config, true),
|
||||||
wterl:config_value(transactional, Config, true),
|
|
||||||
wterl:config_value(session_max, Config, max_sessions(Config)),
|
wterl:config_value(session_max, Config, max_sessions(Config)),
|
||||||
wterl:config_value(cache_size, Config, size_cache(RequestedCacheSize)),
|
wterl:config_value(cache_size, Config, size_cache(RequestedCacheSize)),
|
||||||
wterl:config_value(statistics_log, Config, [{wait, 300}]), % sec
|
wterl:config_value(statistics_log, Config, [{wait, 300}]), % sec
|
||||||
|
@ -562,7 +568,7 @@ size_cache(RequestedSize) ->
|
||||||
TotalRAM = proplists:get_value(system_total_memory, Memory),
|
TotalRAM = proplists:get_value(system_total_memory, Memory),
|
||||||
FreeRAM = proplists:get_value(free_memory, Memory),
|
FreeRAM = proplists:get_value(free_memory, Memory),
|
||||||
UsedByBeam = proplists:get_value(total, erlang:memory()),
|
UsedByBeam = proplists:get_value(total, erlang:memory()),
|
||||||
Target = ((TotalRAM - UsedByBeam) div 4),
|
Target = ((TotalRAM - UsedByBeam) div 3),
|
||||||
FirstGuess = (Target - (Target rem (1024 * 1024))),
|
FirstGuess = (Target - (Target rem (1024 * 1024))),
|
||||||
SecondGuess =
|
SecondGuess =
|
||||||
case FirstGuess > FreeRAM of
|
case FirstGuess > FreeRAM of
|
||||||
|
|
Loading…
Reference in a new issue