Back
24/61
Lesson 24
8 min

SRPS: System Protection

Keep your workstation responsive under heavy agent load

New to ACFS?

Complete the setup wizard first to get the most from these lessons.

Go to Choose Your OS
Goal

Keep your workstation responsive under heavy AI agent load.

What Is SRPS?

SRPS (System Resource Protection Script) installs ananicy-cpp with 1700+ rules to automatically deprioritize background processes, plus sysmoni TUI for real-time monitoring. When AI agents run heavy builds, SRPS keeps your terminal responsive.

Think of it as automatic resource management: compilers, bundlers, and test runners get deprioritized so your interactive sessions stay snappy.

1700+ Rules

Pre-configured for compilers, bundlers, browsers, IDEs

sysmoni TUI

Real-time CPU/memory monitoring with ananicy status

Sysctl Tweaks

Kernel optimizations for responsiveness under memory pressure

Zero Config

Install once, benefits forever - no tuning needed

System Resource Monitoring Center

Select a scenario and toggle SRPS to see real-time resource protection in action

No Protection — Resources Climbing
CPU Cores
Avg 8%
C012%
C110%
C28%
C36%
C49%
C55%
C67%
C74%
Total System CPU8%
Memory
65% used
33%MEM
rustc22%
webpack18%
jest15%
tsc10%
Swap Usage2%
Disk I/O
R 7 MB/sW 3 MB/s
rustcR:5 W:2
webpackR:12 W:6
jestR:3 W:1
tscR:8 W:4
Read
Write
Network
8 Mbps15 Mbps
Upload8%
Download15%
Process Table
Sort by:
PIDProcessAgentCPU%MEM%NiceRule
14823rustcagent-122%22%0none
14901webpackagent-214%18%0none
15042jestagent-314%15%0none
15108tscagent-411%10%0none
4 agent processes tracked by ananicy-cpp
srps-terminal
$

Installation

SRPS installs the ananicy-cpp daemon and sysmoni monitoring tool in one command.

bash
# Install SRPS with all components
$ curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/system_resource_protection_script/main/install.sh | bash -s -- --install
# Verify daemon is running
$ systemctl status ananicy-cpp
> Active: active (running)
Note
Installation requires sudo for systemd service setup and sysctl changes. The script will prompt for confirmation before making system changes.

Real-Time Monitoring with sysmoni

The sysmoni TUI shows real-time CPU and memory usage per process, along with the ananicy rule being applied to each.

bash
# Launch the monitoring TUI
$ sysmoni
# See per-process CPU/memory with ananicy rule status
# q to quit, arrows to navigate, s to sort, f to filter
  • Per-process CPU and memory usage
  • ananicy rule status for each process
  • Nice level and scheduling class
  • Real-time updates (configurable interval)

Essential Commands

Launch real-time process monitoring TUI
Check daemon status
List active rule directories
View daemon logs
Restart after adding custom rules

What Gets Managed

SRPS automatically deprioritizes resource-intensive processes while keeping interactive sessions responsive:

  • Compilers: rustc, gcc, clang, tsc, swc
  • Bundlers: webpack, esbuild, vite, rollup
  • Test runners: cargo test, jest, pytest
  • Browsers: Chrome, Firefox, Electron apps
  • IDEs: VS Code, JetBrains, language servers
Pro Tip
Your terminal emulator, tmux sessions, and input handling stay at normal priority. Heavy builds run in the background without freezing your interactive work.

Adding Custom Rules

You can add rules for any process that SRPS does not know about.

bash
# Example: add rule for a custom heavy process
$ echo '{"name": "my-heavy-process", "nice": 19, "sched": "idle", "ioclass": "idle"}' | \
sudo tee /etc/ananicy.d/00-default/99-custom.rules
# Restart to apply
$ sudo systemctl restart ananicy-cpp
Warning
Be careful with nice values below 0 (higher priority). Only root can set negative nice values, and overusing them can make your system less responsive, not more.

Synergies with Other Tools

  • ntm: Keeps tmux sessions responsive when agents spawn heavy builds
  • slb: Prevents multiple agents from starving each other for CPU/memory
  • dcg: Combined safety - DCG prevents destructive commands, SRPS prevents resource exhaustion
Note
When running multi-agent sessions with SLB, SRPS is especially valuable. Each agent may spawn compilers, test runners, and other heavy processes. SRPS ensures they do not overwhelm your system.

Troubleshooting

If SRPS is not working as expected, check these common issues:

bash
# Check if daemon is running
$ systemctl status ananicy-cpp
# View recent logs
$ journalctl -u ananicy-cpp -n 50
# Validate all rule files
$ ananicy-cpp --config-test
# Uninstall if needed
$ curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/system_resource_protection_script/main/install.sh | bash -s -- --uninstall
Note
If you need to temporarily disable SRPS, use sudo systemctl stop ananicy-cpp. Re-enable with sudo systemctl start ananicy-cpp.

Ready to level up?

Mark complete to track your learning progress.