Dynmaic load shedding

Summary:
add a free system memory limit to Load Shed Configuration for dynamic shedding

Test Plan:
tested on edge241.01.ams3, works as expected. Once the free memory is less than 23G (picked on purpose for testing),  new connections are shedded.   But the shedding rate is totally wrong.  I will explain and address it in another diff.

https://fburl.com/103620501
https://fburl.com/103620701

Reviewed By: afrind@fb.com

Subscribers: trunkagent, fugalh, bmatheny, nimishshah, folly-diffs@, jsedgwick, yfeldblum, chalfant, xning, alexkr

FB internal diff: D2026477

Tasks: 4604893

Signature: t1:2026477:1430176828:65eadd82efa3189a1bebcb8518efaf56cd36beed
This commit is contained in:
Woo Xie
2015-04-28 15:25:31 -07:00
committed by Andrii Grynenko
parent ef0137ceaf
commit 37624c1f29
@@ -87,6 +87,16 @@ class LoadShedConfiguration {
}
double getMaxCpuUsage() const { return maxCpuUsage_; }
/**
* Set/get the minium actual free memory on the system.
*/
void setMinFreeMem(uint64_t min) {
minFreeMem_ = min;
}
uint64_t getMinFreeMem() const {
return minFreeMem_;
}
void setLoadUpdatePeriod(std::chrono::milliseconds period) {
period_ = period;
}
@@ -99,6 +109,7 @@ class LoadShedConfiguration {
AddressSet whitelistAddrs_;
NetworkSet whitelistNetworks_;
uint64_t maxConnections_{0};
uint64_t minFreeMem_{0};
double maxMemUsage_;
double maxCpuUsage_;
std::chrono::milliseconds period_;