Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a93f01f
Run centos and debian workflows on push and PR
igchor Nov 2, 2021
2a8fa60
Adds createPutToken and switches findEviction
byrnedj Feb 4, 2023
c3a4db9
Add memory usage statistics for allocation classes
igchor Jul 6, 2022
2529f0a
Initial multi-tier support implementation (rebased with NUMA and cs p…
igchor Sep 28, 2021
3cc41bd
AC stats multi-tier
byrnedj Jan 17, 2023
bf4c244
This commit contains the additional memory tiers tests
byrnedj Feb 8, 2023
c432df6
This is the additional multi-tier support needed
guptask Nov 14, 2022
4cefc44
added per pool class rolling average latency (upstream PR version)
guptask Jul 21, 2022
1f62a63
added per tier pool class rolling average latency (based on upstream PR)
guptask Jul 21, 2022
489ef20
MM2Q promotion iterators (#1)
byrnedj Aug 9, 2022
048c809
CS Patch Part 2 for mulit-tier cachelib:
byrnedj Feb 7, 2023
ed7b70f
basic multi-tier test based on numa bindings
igchor Dec 30, 2021
94c4974
Aadding new configs to hit_ratio/graph_cache_leader_fobj
vinser52 Jan 27, 2022
afd1456
Do not block reader if a child item is moving
igchor Dec 19, 2022
4f8f425
Background data movement (#20)
byrnedj Oct 21, 2022
6203a95
fix race in moveRegularItemWith sync where insertOrReplace can cause …
byrnedj Feb 16, 2023
6abb498
Fix race in acquire (#68)
igchor Mar 16, 2023
add2e5f
Per tier pool stats (#70)
byrnedj Mar 23, 2023
aedaf97
dummy change to trigger container image rebuild
guptask Mar 28, 2023
1f21fce
Fix token creation and stats (#79)
igchor Apr 27, 2023
9e27d35
Updated the docker gcc version to 12 (#83)
guptask May 9, 2023
da7a6bb
NUMA bindigs support for private memory (#82)
vinser52 May 17, 2023
b5ac462
Do not run cachelib-centos-8-5 on PRs (#85)
igchor Jun 6, 2023
50d3ae5
correct handling for expired items in eviction (#86)
byrnedj Jun 6, 2023
5632d18
Add option to insert items to first free tier (#87)
igchor Jun 8, 2023
09d7bab
Chained item movement between tiers - sync on the parent item (#84)
byrnedj Jun 28, 2023
08d8f33
edit dockerfile
byrnedj Jul 24, 2023
316133c
these submodules work
byrnedj Jul 25, 2023
8d2c390
Track latency of per item eviction/promotion between memory tiers
guptask Jul 28, 2023
b99f2b3
Merge pull request #91 from guptask/tier_eviction_latency
guptask Jul 31, 2023
ff44c3c
Update dependencies (#95)
igchor Aug 23, 2023
307a412
Added Intel Data Movers Library to cachelib dependencies
guptask Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cachelib/allocator/Cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ void CacheBase::updateGlobalCacheStats(const std::string& statPrefix) const {

visitEstimates(uploadStatsNanoToMicro, stats.allocateLatencyNs,
statPrefix + "allocate.latency_us");
visitEstimates(uploadStatsNanoToMicro, stats.bgEvictLatencyNs,
statPrefix + "background.eviction.latency_us");
visitEstimates(uploadStatsNanoToMicro, stats.bgPromoteLatencyNs,
statPrefix + "background.promotion.latency_us");
visitEstimates(uploadStatsNanoToMicro, stats.moveChainedLatencyNs,
statPrefix + "move.chained.latency_us");
visitEstimates(uploadStatsNanoToMicro, stats.moveRegularLatencyNs,
Expand Down
7 changes: 3 additions & 4 deletions cachelib/allocator/CacheAllocator-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,16 @@ CacheAllocator<CacheTrait>::allocateInternalTier(TierId tid,
uint32_t expiryTime,
bool fromBgThread,
bool evict) {
util::LatencyTracker tracker{stats().allocateLatency_};

util::LatencyTracker tracker{stats().allocateLatency_, static_cast<size_t>(!fromBgThread)};
SCOPE_FAIL { stats_.invalidAllocs.inc(); };

// number of bytes required for this item
const auto requiredSize = Item::getRequiredSize(key, size);

// the allocation class in our memory allocator.
const auto cid = allocator_[tid]->getAllocationClassId(pid, requiredSize);
util::RollingLatencyTracker rollTracker{
(*stats_.classAllocLatency)[tid][pid][cid]};

util::RollingLatencyTracker rollTracker{(*stats_.classAllocLatency)[tid][pid][cid]};

(*stats_.allocAttempts)[tid][pid][cid].inc();

Expand Down
4 changes: 3 additions & 1 deletion cachelib/allocator/CacheAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,8 @@ class CacheAllocator : public CacheBase {
// exposed for the background evictor to iterate through the memory and evict
// in batch. This should improve insertion path for tiered memory config
size_t traverseAndEvictItems(unsigned int tid, unsigned int pid, unsigned int cid, size_t batch) {
auto& mmContainer = getMMContainer(tid, pid, cid);
util::LatencyTracker tracker{stats().bgEvictLatency_, batch};
auto& mmContainer = getMMContainer(tid, pid, cid);
size_t evictions = 0;
size_t evictionCandidates = 0;
std::vector<Item*> candidates;
Expand Down Expand Up @@ -2089,6 +2090,7 @@ auto& mmContainer = getMMContainer(tid, pid, cid);
}

size_t traverseAndPromoteItems(unsigned int tid, unsigned int pid, unsigned int cid, size_t batch) {
util::LatencyTracker tracker{stats().bgPromoteLatency_, batch};
auto& mmContainer = getMMContainer(tid, pid, cid);
size_t promotions = 0;
std::vector<Item*> candidates;
Expand Down
2 changes: 2 additions & 0 deletions cachelib/allocator/CacheStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ void Stats::populateGlobalCacheStats(GlobalCacheStats& ret) const {
ret.numNvmItemDestructorAllocErrors = numNvmItemDestructorAllocErrors.get();

ret.allocateLatencyNs = this->allocateLatency_.estimate();
ret.bgEvictLatencyNs = this->bgEvictLatency_.estimate();
ret.bgPromoteLatencyNs = this->bgPromoteLatency_.estimate();
ret.moveChainedLatencyNs = this->moveChainedLatency_.estimate();
ret.moveRegularLatencyNs = this->moveRegularLatency_.estimate();
ret.nvmLookupLatencyNs = this->nvmLookupLatency_.estimate();
Expand Down
2 changes: 2 additions & 0 deletions cachelib/allocator/CacheStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ struct GlobalCacheStats {

// latency and percentile stats of various cachelib operations
util::PercentileStats::Estimates allocateLatencyNs{};
util::PercentileStats::Estimates bgEvictLatencyNs{};
util::PercentileStats::Estimates bgPromoteLatencyNs{};
util::PercentileStats::Estimates moveChainedLatencyNs{};
util::PercentileStats::Estimates moveRegularLatencyNs{};
util::PercentileStats::Estimates nvmLookupLatencyNs{};
Expand Down
2 changes: 2 additions & 0 deletions cachelib/allocator/CacheStatsInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ struct Stats {

// latency stats of various cachelib operations
mutable util::PercentileStats allocateLatency_;
mutable util::PercentileStats bgEvictLatency_;
mutable util::PercentileStats bgPromoteLatency_;
mutable util::PercentileStats moveChainedLatency_;
mutable util::PercentileStats moveRegularLatency_;
mutable util::PercentileStats nvmLookupLatency_;
Expand Down
2 changes: 2 additions & 0 deletions cachelib/cachebench/cache/Cache-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ Stats Cache<Allocator>::getStats() const {
static_cast<int64_t>(itemRecords_.count()) - totalDestructor_;

ret.cacheAllocateLatencyNs = cacheStats.allocateLatencyNs;
ret.cacheBgEvictLatencyNs = cacheStats.bgEvictLatencyNs;
ret.cacheBgPromoteLatencyNs = cacheStats.bgPromoteLatencyNs;
ret.cacheFindLatencyNs = cacheFindLatency_.estimate();

// Populate counters.
Expand Down
6 changes: 6 additions & 0 deletions cachelib/cachebench/cache/CacheStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ struct Stats {
uint64_t numNvmItemRemovedSetSize{0};

util::PercentileStats::Estimates cacheAllocateLatencyNs;
util::PercentileStats::Estimates cacheBgEvictLatencyNs;
util::PercentileStats::Estimates cacheBgPromoteLatencyNs;
util::PercentileStats::Estimates cacheFindLatencyNs;

double nvmReadLatencyMicrosP50{0};
Expand Down Expand Up @@ -282,6 +284,8 @@ struct Stats {

printLatencies("Cache Find API latency", cacheFindLatencyNs);
printLatencies("Cache Allocate API latency", cacheAllocateLatencyNs);
printLatencies("Cache Background Eviction API latency", cacheBgEvictLatencyNs);
printLatencies("Cache Background Promotion API latency", cacheBgPromoteLatencyNs);
}
}

Expand Down Expand Up @@ -510,6 +514,8 @@ struct Stats {

counters["find_latency_p99"] = cacheFindLatencyNs.p99;
counters["alloc_latency_p99"] = cacheAllocateLatencyNs.p99;
counters["bg_evict_latency_p99"] = cacheBgEvictLatencyNs.p99;
counters["bg_promote_latency_p99"] = cacheBgPromoteLatencyNs.p99;

counters["ram_hit_rate"] = calcInvertPctFn(numCacheGetMiss, numCacheGets);
counters["nvm_hit_rate"] = calcInvertPctFn(numCacheGetMiss, numCacheGets);
Expand Down
11 changes: 6 additions & 5 deletions cachelib/common/PercentileStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,24 @@ class PercentileStats {

class LatencyTracker {
public:
explicit LatencyTracker(PercentileStats& stats)
: stats_(&stats), begin_(std::chrono::steady_clock::now()) {}
explicit LatencyTracker(PercentileStats& stats, size_t nSamples = 1)
: stats_(&stats), nSamples_(nSamples), begin_(std::chrono::steady_clock::now()) {}
LatencyTracker() {}
~LatencyTracker() {
if (stats_) {
if (nSamples_ > 0 && stats_) {
auto tp = std::chrono::steady_clock::now();
auto diffNanos =
std::chrono::duration_cast<std::chrono::nanoseconds>(tp - begin_)
.count();
stats_->trackValue(static_cast<double>(diffNanos), tp);
stats_->trackValue(static_cast<double>(diffNanos/nSamples_), tp);
}
}

LatencyTracker(const LatencyTracker&) = delete;
LatencyTracker& operator=(const LatencyTracker&) = delete;

LatencyTracker(LatencyTracker&& rhs) noexcept
: stats_(rhs.stats_), begin_(rhs.begin_) {
: stats_(rhs.stats_), nSamples_(rhs.nSamples_), begin_(rhs.begin_) {
rhs.stats_ = nullptr;
}

Expand All @@ -138,6 +138,7 @@ class LatencyTracker {

private:
PercentileStats* stats_{nullptr};
size_t nSamples_{1};
std::chrono::time_point<std::chrono::steady_clock> begin_;
};
} // namespace util
Expand Down
2 changes: 1 addition & 1 deletion cachelib/external/fbthrift
Submodule fbthrift updated 4984 files
2 changes: 1 addition & 1 deletion cachelib/external/fizz
Submodule fizz updated 130 files
2 changes: 1 addition & 1 deletion cachelib/external/folly
Submodule folly updated 393 files
2 changes: 1 addition & 1 deletion cachelib/external/wangle
Submodule wangle updated 50 files
+1 −1 build/deps/github_hashes/facebook/folly-rev.txt
+1 −1 build/deps/github_hashes/facebookincubator/fizz-rev.txt
+0 −1 build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+0 −1 build/fbcode_builder/CMake/FindGflags.cmake
+10 −8 build/fbcode_builder/getdeps.py
+3 −0 build/fbcode_builder/getdeps/cargo.py
+3 −3 build/fbcode_builder/getdeps/dyndeps.py
+1 −0 build/fbcode_builder/getdeps/manifest.py
+0 −1 build/fbcode_builder/getdeps/platform.py
+17 −0 build/fbcode_builder/manifests/OpenNSA
+0 −13 build/fbcode_builder/manifests/benchmark
+0 −11 build/fbcode_builder/manifests/blake3
+1 −0 build/fbcode_builder/manifests/boost
+0 −10 build/fbcode_builder/manifests/date
+4 −1 build/fbcode_builder/manifests/eden
+0 −1 build/fbcode_builder/manifests/edencommon
+1 −0 build/fbcode_builder/manifests/fboss
+3 −3 build/fbcode_builder/manifests/fmt
+1 −1 build/fbcode_builder/manifests/libsodium
+2 −2 build/fbcode_builder/manifests/lz4
+68 −0 build/fbcode_builder/manifests/sapling
+39 −0 build/fbcode_builder/manifests/traffixr
+0 −33 build/fbcode_builder/manifests/zstrong
+0 −97 build/fbcode_builder/patches/blake3_CMakeLists_txt.patch
+4 −4 wangle/acceptor/AcceptObserver.h
+23 −86 wangle/acceptor/Acceptor.cpp
+5 −18 wangle/acceptor/Acceptor.h
+0 −5 wangle/acceptor/AcceptorHandshakeManager.cpp
+0 −7 wangle/acceptor/AcceptorHandshakeManager.h
+27 −30 wangle/acceptor/ConnectionManager.cpp
+13 −19 wangle/acceptor/ConnectionManager.h
+10 −25 wangle/acceptor/FizzAcceptorHandshakeHelper.cpp
+5 −29 wangle/acceptor/FizzAcceptorHandshakeHelper.h
+0 −3 wangle/acceptor/FizzConfig.h
+1 −3 wangle/acceptor/ManagedConnection.cpp
+0 −13 wangle/acceptor/ManagedConnection.h
+11 −3 wangle/acceptor/SSLContextSelectionMisc.h
+1 −16 wangle/acceptor/ServerSocketConfig.h
+1 −15 wangle/acceptor/SharedSSLContextManager.h
+2 −2 wangle/acceptor/TransportInfo.cpp
+23 −38 wangle/acceptor/test/AcceptorTest.cpp
+34 −124 wangle/acceptor/test/ConnectionManagerTest.cpp
+1 −27 wangle/bootstrap/ServerBootstrap-inl.h
+3 −7 wangle/bootstrap/ServerBootstrap.h
+0 −6 wangle/client/ssl/test/ThreadSafeSSLSessionCacheTest.cpp
+3 −0 wangle/ssl/ClientHelloExtStats.h
+0 −31 wangle/ssl/SNIConfig.h
+124 −142 wangle/ssl/SSLContextManager.cpp
+7 −67 wangle/ssl/SSLContextManager.h
+184 −355 wangle/ssl/test/SSLContextManagerTest.cpp
2 changes: 2 additions & 0 deletions docker/images/centos-8streams.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ json-c-devel \
perf \
numactl

# updated to fix compile errors and better symbol
# resolving in VTune
RUN dnf -y install gcc-toolset-12
RUN echo "source /opt/rh/gcc-toolset-12/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]
Expand Down