Mas i1801 2iqueryperf#1802
Conversation
Rather than just option to log, stats will be updated as with get_fsm and put_fsm. Stats include response time histogram, but also a histogram of result counts. This should be useful for identifying when there are issues related to very large result sets being returned, and establish any non-linear relationship between query time and result counts.
the monitoring of these times has switched to riak_core e.g. worker_af4_pool_queuetime_mean" worker_af4_pool_queuetime_100 worker_af4_pool_worktime_mean worker_af4_pool_worktime_100 worker_vnode_pool_queuetime_mean worker_vnode_pool_queuetime_100 worker_vnode_pool_worktime_mean worker_vnode_pool_worktime_100
Previously only possible to set this via advanced.config. The default has been reduced, as with a large pool, it is possible that context switching between a vast number of concurrent folds could be slower overall than simply queueing some folds to allow others to complete. Even on volume tests with 1% of transactions using 2i queries, a pool size of 4 is never exhausted.
|
|
||
| {deps, [ | ||
| {riak_core, {git, "https://github.com/basho/riak_core.git", {tag, "riak_kv-3.0.8"}}}, | ||
| {riak_core, {git, "https://github.com/basho/riak_core.git", {branch, "mas-i1801-monitorworkerq"}}}, |
There was a problem hiding this comment.
work needed before merge (I mean, don't forget to reset to right branches)
| end, | ||
| TotalResults = length(LastResults) + ResultsSent, | ||
| DownTheWire = | ||
| case TotalResults > MaxResults of |
There was a problem hiding this comment.
We don't need TotalResults. The function lists:sublist takes care of this, taking only the MaxResult - ResultSent is sufficient, making the code substantially easier:
There was a problem hiding this comment.
| case TotalResults > MaxResults of |
There was a problem hiding this comment.
MaxResults, it turns out can be the atom all as well as an integer(), and this relies on the fact any integer() > atom() is false.
So if we just have lists:sublist we get badarith.
But it is a bit worse, as it is also possible to construct a query whereby MaxResults is undefined, but a page-sort query is still requested. undefined isn't expected by dialyzer.
Going to make the case of all vs integer() more specific, and ensure that not integer() is always all
| false -> | ||
| LastResults | ||
| end, | ||
| TotalResults = length(LastResults) + ResultsSent, |
There was a problem hiding this comment.
| TotalResults = length(LastResults) + ResultsSent, |
| TotalResults = length(LastResults) + ResultsSent, | ||
| DownTheWire = | ||
| case TotalResults > MaxResults of | ||
| true -> |
There was a problem hiding this comment.
| true -> |
| DownTheWire = | ||
| case TotalResults > MaxResults of | ||
| true -> | ||
| lists:sublist(LastResults, MaxResults - ResultsSent); |
There was a problem hiding this comment.
| lists:sublist(LastResults, MaxResults - ResultsSent); | |
| lists:sublist(LastResults, MaxResults - ResultsSent), |
| case TotalResults > MaxResults of | ||
| true -> | ||
| lists:sublist(LastResults, MaxResults - ResultsSent); | ||
| false -> |
There was a problem hiding this comment.
| false -> |
| true -> | ||
| lists:sublist(LastResults, MaxResults - ResultsSent); | ||
| false -> | ||
| LastResults |
There was a problem hiding this comment.
| LastResults |
| lists:sublist(LastResults, MaxResults - ResultsSent); | ||
| false -> | ||
| LastResults | ||
| end, |
| ok = do_stages([P, ?APP, node, puts, Type, time], Stages), | ||
| do_put_bucket(PerBucket, {Bucket, Microsecs, Stages, Type}); | ||
| do_update({index_fsm_time, Microsecs, ResultCount}) -> | ||
| P = ?PFX, |
There was a problem hiding this comment.
Correct, but I like 3 copies of ?PFX in arguments below better... Renaming a macro makes it not as easy to see that a macro is used.
In line 272 below the macro is also used, so more in line with that code
There was a problem hiding this comment.
The convention in the module is that if ?PFX is required more than once in a function, it is called then assigned rather than repeatedly called. It might be a performance thing (this a very active piece of code, ignoring excess calls to get_env), or perhaps a consistency thing (so that the prefix can't change across a set of updates.
Without knowing why this is the convention, I don't wish to change it.
if N > length of list, whole list sent in lists:sublist
mas-i1801-monitorworkerq now merged in
|
Full list of stats added by this PR: index_fsm_complete
index_fsm_results_mean
index_fsm_time_mean
worker_vnode_pool_queuetime_mean"
worker_af1_pool_queuetime_mean"
|
Adds stats to secondary index queries. Adds to riak stats for each vnode fold, and adds an optional log to the
riak_kv_index_fsm.The optional log can be enabled by setting
riak_kv.log_index_fsmto true (or enabling this via riak.conf).Dependencies are updated to included the revised
riak_core_coverage_plan:initiate_plan/5function which offers significant performance advantages for larger ring_sizes.