Commit 37624c1f authored by Woo Xie's avatar Woo Xie Committed by Andrii Grynenko

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
parent ef0137ce
......@@ -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_;
......
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