Commit 51c927b8 authored by Edward Chin's avatar Edward Chin Committed by Dave Watson

add custom getLoad() for multifeed leaf

Summary:
getLoad() is called in servicerouter loadbalancing when a load_counter is not specified.  I added a custom getLoad() for leaf and made it so that different metrics can be tested without code pushes.

Changes:
1) Overloaded PriorityThreadManager::getCodel() so you can specify a PRIORITY.  aggr->leaf thrift calls are marked as HIGH priority.
2) The value of FLAGS_load_metric determines what metric the custom getLoad() will use (codel, max requests, or fallback to ThriftServer::getLoad()).
3) Smc listener for FLAGS_load_metric.
4) Removed server->setIsUnevenLoad(false) since there isn't reason this need to be set, and activeRequests_ and getPendingCount() are not tracked when isUnevenLoad_ is false.

Test Plan: Run leaf and check that smc listener works.  Custom getLoad() won't be called until t5625774 is resolved.

Reviewed By: hitesh@fb.com

Subscribers: njormrod, folly-diffs@, trunkagent, varunk, fugalh, alandau, nkgupta, bmatheny, jaredg, xie, mshneer, yguo

FB internal diff: D1685215

Signature: t1:1685215:1416339297:0d1f8cb0cec27242d95f0067337d80149b0a720e
parent 998b419a
......@@ -80,7 +80,12 @@ bool Codel::overloaded(std::chrono::microseconds delay) {
}
int Codel::getLoad() {
return std::min(100, (int)codelMinDelay_.count() / FLAGS_codel_interval);
return std::min(100, (int)codelMinDelay_.count() /
(2 * FLAGS_codel_target_delay));
}
int Codel::getMinDelay() {
return (int) codelMinDelay_.count();
}
}} //namespace
......@@ -50,6 +50,8 @@ class Codel {
// Return: 0 = no delay, 100 = At the queueing limit
int getLoad();
int getMinDelay();
private:
std::chrono::microseconds codelMinDelay_;
std::chrono::time_point<std::chrono::steady_clock> codelIntervalTime_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment