Skip to main content

Set of tools to monitor memory activity.

Project description

pagecache_hit_miss

Overview

This is a set of tools to monitor the memory used as pagecache.

For now it only has a tool which monitors the pagecache hit/miss

The idea is to add more tools, for example unify the pagecache_ttl (currently in an independent repo) https://github.com/sciclon2/pagecache_ttl

Technical details

The cache hit and miss metric is gathered counting the kernel functions, following the Brendan Gregg idea https://www.brendangregg.com/blog/2014-12-31/linux-page-cache-hit-ratio.html

Using eBPF we track and cound the following Kernel functions:

  • mark_page_accessed() for measuring cache accesses
  • mark_buffer_dirty() for measuring cache writes
  • add_to_page_cache_lru() for measuring page additions
  • account_page_dirtied() for measuring page dirties

Dependencies

This tool needs BCC, please follow the instructions bellow: https://github.com/iovisor/bcc/blob/master/INSTALL.md

Installation

Via pip:

foo@bar:~# pip install pagecache_tools

Local in this repository root:

foo@bar:~# pip install -e .

Example

foo@bar:~# /usr/local/bin/pagecache_hit_miss  --help
usage: pagecache_hit_miss [-h] [--interval-seconds INTERVAL_SECONDS]
                          [--daemon] [--send-metrics-to-dogstatsd]
                          [--log-level {INFO,DEBUG}] [--log-file LOG_FILE]

PageCache Hit/Miss

optional arguments:
  -h, --help            show this help message and exit
  --interval-seconds INTERVAL_SECONDS
                        Sets the interval to get the missed/hit values and
                        calculate the avg.
  --daemon              Execute the program in daemon mode.
  --send-metrics-to-dogstatsd
                        Send metrics to local DogStatsD
                        https://docs.datadoghq.com/developers/dogstatsd/
  --log-level {INFO,DEBUG}
                        Sets the log level
  --log-file LOG_FILE   Sets the log file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pagecache_tools-1.0.0.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file pagecache_tools-1.0.0.tar.gz.

File metadata

  • Download URL: pagecache_tools-1.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pagecache_tools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2cc48a5d68697a47d69dbaff355d7c3c1531859dd0bbe7097e2ad8fb8bd600ca
MD5 3bd6cee772fe646afd07325a83a02e0d
BLAKE2b-256 1408cebf49929631748c45edb2984b3b83a6867abbd05859bed054138b5ef20f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page