Minor machi_basho_bench_driver changes

This commit is contained in:
Scott Lystig Fritchie 2015-05-20 18:44:04 +09:00
parent 436fa5b3a9
commit 9e41162e65
3 changed files with 16 additions and 3 deletions

View file

@ -17,6 +17,12 @@
%{concurrent, 10}.
%% Here's a chain of (up to) length 3, all on localhost
%% Note: if any servers are down, and your OS/TCP stack has an
%% ICMP response limit such as OS X's "net.inet.icmp.icmplim" setting,
%% then if that setting is very low (e.g., OS X's limit is 50), then
%% you can have big problems with ICMP/RST responses being delayed and
%% interactive *very* badly with your test.
%% For OS X, fix using "sudo sysctl -w net.inet.icmp.icmplim=9999"
{machi_server_info,
[
{p_srvr,a,machi_flu1_client,"localhost",4444,[]},

View file

@ -17,6 +17,12 @@
%{concurrent, 10}.
%% Here's a chain of (up to) length 3, all on localhost
%% Note: if any servers are down, and your OS/TCP stack has an
%% ICMP response limit such as OS X's "net.inet.icmp.icmplim" setting,
%% then if that setting is very low (e.g., OS X's limit is 50), then
%% you can have big problems with ICMP/RST responses being delayed and
%% interactive *very* badly with your test.
%% For OS X, fix using "sudo sysctl -w net.inet.icmp.icmplim=9999"
{machi_server_info,
[
{p_srvr,a,machi_flu1_client,"localhost",4444,[]},

View file

@ -65,6 +65,7 @@
}).
-define(ETS_TAB, machi_keys).
-define(THE_TIMEOUT, 60*1000).
-define(INFO(Str, Args), lager:info(Str, Args)).
-define(WARN(Str, Args), lager:warning(Str, Args)).
@ -94,7 +95,7 @@ new(Id) ->
run(append, KeyGen, ValueGen, #m{conn=Conn}=S) ->
Prefix = KeyGen(),
Value = ValueGen(),
case machi_cr_client:append_chunk(Conn, Prefix, Value) of
case machi_cr_client:append_chunk(Conn, Prefix, Value, ?THE_TIMEOUT) of
{ok, Pos} ->
EtsKey = ets:update_counter(?ETS_TAB, max_key, 1),
true = ets:insert(?ETS_TAB, {EtsKey, Pos}),
@ -111,12 +112,12 @@ run(read, KeyGen, _ValueGen, #m{conn=Conn, max_key=MaxKey}=S) ->
Idx = KeyGen() rem MaxKey,
%% {File, Offset, Size, _CSum} = ets:lookup_element(?ETS_TAB, Idx, 2),
{File, Offset, Size} = ets:lookup_element(?ETS_TAB, Idx, 2),
case machi_cr_client:read_chunk(Conn, File, Offset, Size) of
case machi_cr_client:read_chunk(Conn, File, Offset, Size, ?THE_TIMEOUT) of
{ok, _Chunk} ->
{ok, S};
{error, _}=Err ->
?ERROR("read file ~p offset ~w size ~w: ~w\n",
[File, Offset, Size]),
[File, Offset, Size, Err]),
{error, Err, S}
end.