Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory and cache stats to PeriodicStatsReporter #9723

Closed

Conversation

tanjialiang
Copy link
Contributor

@tanjialiang tanjialiang commented May 6, 2024

Added memory allocator and cache stats to PeriodicStatsReporter.
Added documentations to monitoring doc.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 6, 2024
Copy link

netlify bot commented May 6, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 72a371a
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/663c21364c87dc0008bc70f5

@tanjialiang tanjialiang changed the title Add stats report daemon to Velox Add memory and cache stats to PeriodicStatsReporter May 6, 2024
@@ -39,13 +41,22 @@ class PeriodicStatsReporter {
struct Options {
Options() {}

const memory::MemoryArbitrator* arbitrator{nullptr};
const velox::memory::MemoryAllocator* const allocator{nullptr};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const velox::memory::MemoryAllocator* allocator{nullptr};
const velox::cache::AsyncDataCache* cache{nullptr};

if (auto* mmapAllocator =
dynamic_cast<const velox::memory::MmapAllocator*>(allocator_)) {
RECORD_METRIC_VALUE(
kMetricMmapRawAllocBytesSmall, (mmapAllocator->numMallocBytes()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/kMetricMmapRawAllocBytesSmall/kMetricMmapDelegatedAllocBytes/?

const auto cacheStats = cache_->refreshStats();

// Snapshots.
RECORD_METRIC_VALUE(kMetricMemoryCacheNumEntries, cacheStats.numEntries);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a velox change and you update SSD cache production with these non-average stats? Or you first report average stats and does the non-average stats in followup? Thanks!

@tanjialiang tanjialiang force-pushed the add_alloc_mem_stats branch 2 times, most recently from 2d391c5 to 0fb06c7 Compare May 8, 2024 01:25
@tanjialiang tanjialiang marked this pull request as ready for review May 8, 2024 01:25
@facebook-github-bot
Copy link
Contributor

@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@tanjialiang tanjialiang force-pushed the add_alloc_mem_stats branch 3 times, most recently from a340965 to cf8ebda Compare May 8, 2024 03:40
Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanjialiang LGTM % minors. Thanks!

velox/common/base/Counters.h Outdated Show resolved Hide resolved
velox/common/base/Counters.h Outdated Show resolved Hide resolved
velox/common/base/Counters.h Outdated Show resolved Hide resolved
velox/common/base/Counters.h Show resolved Hide resolved
velox/common/base/Counters.h Outdated Show resolved Hide resolved
velox/common/base/PeriodicStatsReporter.cpp Outdated Show resolved Hide resolved
velox/common/base/PeriodicStatsReporter.cpp Outdated Show resolved Hide resolved
velox/common/base/PeriodicStatsReporter.cpp Outdated Show resolved Hide resolved
velox/common/base/PeriodicStatsReporter.cpp Outdated Show resolved Hide resolved
velox/common/base/PeriodicStatsReporter.cpp Outdated Show resolved Hide resolved
@tanjialiang tanjialiang force-pushed the add_alloc_mem_stats branch 2 times, most recently from 46da2b2 to 05e9cd4 Compare May 8, 2024 15:33
@facebook-github-bot
Copy link
Contributor

@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@tanjialiang tanjialiang requested a review from xiaoxmeng May 8, 2024 16:41
Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanjialiang LGTM. Thanks!

@facebook-github-bot
Copy link
Contributor

@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@zacw7 zacw7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

// Total number of bytes written to SSD.
DEFINE_METRIC(kMetricSsdCacheWrittenBytes, facebook::velox::StatType::SUM);

// Cumulative number of SsdCache entries that are aged out and evicted given
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cumulative -> Total to be consistent with other comments?

// configured TTL.
DEFINE_METRIC(kMetricSsdCacheAgedOutEntries, facebook::velox::StatType::SUM);

// Cumulative number of SsdCache regions that are aged out and evicted given
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

tanjialiang added a commit to tanjialiang/velox-1 that referenced this pull request May 8, 2024
…r#9723)

Summary:
Added memory allocator and cache stats to PeriodicStatsReporter. 
Added documentations to monitoring doc.


Reviewed By: xiaoxmeng, zacw7

Differential Revision: D57085696

Pulled By: tanjialiang
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57085696

…r#9723)

Summary:
Added memory allocator and cache stats to PeriodicStatsReporter. 
Added documentations to monitoring doc.


Reviewed By: xiaoxmeng, zacw7

Differential Revision: D57085696

Pulled By: tanjialiang
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57085696

@facebook-github-bot
Copy link
Contributor

@tanjialiang merged this pull request in b8a26ce.

Copy link

Conbench analyzed the 1 benchmark run on commit b8a26ce8.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Jun 7, 2024
…r#9723)

Summary:
Added memory allocator and cache stats to PeriodicStatsReporter.
Added documentations to monitoring doc.

Pull Request resolved: facebookincubator#9723

Reviewed By: xiaoxmeng, zacw7

Differential Revision: D57085696

Pulled By: tanjialiang

fbshipit-source-id: 7dbc3791d314212e0c7658d0d868dac074f34fcf
Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Jun 7, 2024
…r#9723)

Summary:
Added memory allocator and cache stats to PeriodicStatsReporter.
Added documentations to monitoring doc.

Pull Request resolved: facebookincubator#9723

Reviewed By: xiaoxmeng, zacw7

Differential Revision: D57085696

Pulled By: tanjialiang

fbshipit-source-id: 7dbc3791d314212e0c7658d0d868dac074f34fcf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants