{"id":17700691,"url":"https://github.com/cdown/psi-notify","last_synced_at":"2025-04-13T07:49:49.964Z","repository":{"id":52489717,"uuid":"258591006","full_name":"cdown/psi-notify","owner":"cdown","description":"Alert when your machine is becoming oversaturated, *before* it slows to a crawl","archived":false,"fork":false,"pushed_at":"2025-02-18T16:18:19.000Z","size":219,"stargazers_count":229,"open_issues_count":1,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-13T07:49:44.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-24T18:24:58.000Z","updated_at":"2025-03-24T14:20:51.000Z","dependencies_parsed_at":"2024-12-25T01:10:42.485Z","dependency_job_id":"3a959416-9355-4f4b-ad98-d4cb781ad618","html_url":"https://github.com/cdown/psi-notify","commit_stats":{"total_commits":286,"total_committers":4,"mean_commits":71.5,"dds":"0.027972027972028024","last_synced_commit":"60e2f2cfe2d3ae5194251b94219a50cf099e2f52"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fpsi-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fpsi-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fpsi-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Fpsi-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdown","download_url":"https://codeload.github.com/cdown/psi-notify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T17:42:50.264Z","updated_at":"2025-04-13T07:49:49.931Z","avatar_url":"https://github.com/cdown.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# psi-notify | [![Tests](https://img.shields.io/github/actions/workflow/status/cdown/psi-notify/ci.yml?branch=master)](https://github.com/cdown/psi-notify/actions?query=branch%3Amaster) [![CodeQL](https://img.shields.io/github/actions/workflow/status/cdown/psi-notify/codeql.yml?branch=master\u0026label=codeql)](https://github.com/cdown/psi-notify/actions?query=branch%3Amaster)\n\n**tl;dr: psi-notify can alert you when resources on your machine are becoming\noversaturated, and allow you to take action *before* your system slows to a\ncrawl.**\n\n![](demo.gif)\n\npsi-notify is a minimal unprivileged notifier for system-wide resource pressure\nusing [PSI](https://facebookmicrosites.github.io/psi/). This can help you to\nidentify misbehaving applications on your machine before they start to severely\nimpact system responsiveness, in a way which `MemAvailable`, CPU graphs, I/O\nutilisation graphs and other metrics cannot.\n\n## Features\n\n- Runs unprivileged\n- Minimal resource usage\n- Works with any notifier using [Desktop\n  Notifications](https://specifications.freedesktop.org/notification-spec/latest/)\n\n## Requirements\n\n- Linux 4.20+ with `CONFIG_PSI` (enabled by default in most distributions)\n- libnotify\n\n## Installation\n\nOn Arch, the [psi-notify AUR\npackage](https://aur.archlinux.org/packages/psi-notify/) is available.\n\nOn Debian (bookworm and sid), the [psi-notify package\n](https://packages.debian.org/search?keywords=psi-notify) is available.\n\nOn Fedora and RHEL/CentOS 8, the [psi-notify\npackage](https://src.fedoraproject.org/rpms/psi-notify) is available in\nFedora/EPEL.\n\nOn Ubuntu, the [psi-notify package\n](https://packages.ubuntu.com/search?keywords=psi-notify) is in kinetic. For\nolder releases, please use the [psi-notify PPA\n](https://launchpad.net/~michel-slm/+archive/ubuntu/psi-notify).\n\nYou can also find packages in [Repology\n](https://repology.org/project/psi-notify/versions).\n\nOtherwise, manual installation is as simple as running `make` and putting the\nresulting `psi-notify` binary in your PATH. You will need `libnotify`\ninstalled.\n\nAfter that, you just start psi-notify. A systemd user service is packaged and\ncan be used like so:\n\n    systemctl --user start psi-notify\n\n## Config\n\nPut your configuration in `~/.config/psi-notify`. Here's an example that will\ncheck roughly every 5 seconds⁺, and pop up a notification when the values are\nexceeded:\n\n```\nupdate 5\nlog_pressures false\n\nthreshold cpu some avg10 50.00\nthreshold memory some avg10 10.00\nthreshold io full avg10 15.00\n```\n\nThe above is the default configuration if no config file exists. You may have\nto tweak these depending on your hardware, machine behaviour, and normal\nworkloads.\n\nYou can reload the config without restarting by sending `SIGHUP` to psi-notify.\n\nLook at the \"config format\" section below to find out more about what a valid\nconfig looks like.\n\n⁺ PSI has poll() support, but it's not currently available to unprivileged\nusers. See [this\ndiscussion](https://lore.kernel.org/lkml/20200424153859.GA1481119@chrisdown.name).\n\n## Comparison with oomd\n\n[oomd](https://github.com/facebookincubator/oomd) and psi-notify are two\ncompatible and complementary projects -- they're not in opposition to each\nother. oomd also uses PSI metrics, but it requires a policy about \"what to\nkill\" in high-pressure scenarios. For example, on a web server we obviously\ndon't want to kill the web server if we can avoid that, so we should prioritise\nother applications. On the desktop though, it's hard to say: should we kill\nChrome, or some IDE, or maybe something playing a movie? It's extremely\ndifficult (although perhaps possible) to produce a single configuration that\nwill do the right thing in even the majority of cases, so we opt to alert early\ninstead and have the user make the decision about what's high priority in their\nuser session. When integrating oomd for the desktop, most distributions will\nlikely end up having to make it less aggressive than would be ideal, so they\ncan still interoperate.\n\nIt's hard to produce a good policy for, say, one's working day, where at one\ntime my terminal is the most critical thing, at another my browser is, and at\nanother it's my mail client. At other times maybe I'm ok with the slowdown and\nam willing to ride it out without killing anything. psi-notify sidesteps this\nproblem by simply notifying, rather than taking action.\n\n## Config format\n\n### update\n\nThe update interval in seconds is specified with `update [int]`. The default is\n`update 5` if unspecified.\n\n### log_pressures\n\nIf you'd like messages like this at every update interval, you can set\n`log_pressures true` (the default is `false`):\n\n```\nINFO: Current CPU pressures: some avg10=0.00 avg60=0.02 avg300=0.01\nINFO: Current memory pressures: some avg10=0.00 avg60=0.00 avg300=0.00\nINFO: Current memory pressures: full avg10=0.00 avg60=0.00 avg300=0.00\nINFO: Current I/O pressures: some avg10=0.00 avg60=0.00 avg300=0.00\nINFO: Current I/O pressures: full avg10=0.00 avg60=0.00 avg300=0.00\n```\n\n### threshold\n\nThresholds are specified with fields in the following format:\n\n1. The word `threshold`.\n2. The resource name, as shown in `cgroup.controllers`. `cpu`, `memory`, and\n   `io` are currently supported.\n3. Whether to use the `some` or `full` metric. See the definition\n   [here](https://facebookmicrosites.github.io/psi/docs/overview#pressure-metric-definitions).\n4. The PSI time period. `avg10`, `avg60`, and `avg300` are currently supported.\n5. The threshold, as a real number between 0 and 100. Decimals are ok.\n\n## Contributing\n\nIssues and pull requests are welcome! Please feel free to file them [on\nGitHub](https://github.com/cdown/psi-notify).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdown%2Fpsi-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdown%2Fpsi-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdown%2Fpsi-notify/lists"}