psutil

Cross-platform Python library for accessing system and process information. psutil provides CPU usage, memory stats, disk I/O, network connections, and process management (list, kill, inspect) through a unified Python API that works on Linux, macOS, and Windows. Used in monitoring agents, resource-aware task schedulers, and system health checks.

Evaluated Mar 06, 2026 (0d ago) v5.9+
Homepage ↗ Repo ↗ Developer Tools system monitoring process cpu memory disk network python cross-platform
⚙ Agent Friendliness
70
/ 100
Can an agent use this?
🔒 Security
97
/ 100
Is it safe for agents?
⚡ Reliability
92
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
90
Error Messages
85
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
92
Secret Handling
90

Local execution only. Process inspection capabilities could leak sensitive info (command lines with passwords) — ensure agents using psutil don't log raw process command lines.

⚡ Reliability

Uptime/SLA
100
Version Stability
92
Breaking Changes
90
Error Recovery
88
AF Security Reliability

Best When

You need simple, cross-platform system resource inspection in a Python script or agent without external monitoring infrastructure.

Avoid When

You need distributed fleet monitoring, container-aware cgroup metrics, or time-series metric collection — use proper observability infrastructure.

Use Cases

  • Build agent health checks that verify system resource availability before starting compute-intensive tasks — check CPU, memory, and disk usage
  • Monitor agent process resource consumption (CPU%, memory RSS) and implement auto-scaling or throttling based on psutil metrics
  • Enumerate running processes to detect required services (databases, queues) are up before agent workflows begin
  • Collect system telemetry for agent observability dashboards — CPU per-core, network bytes sent/received, disk read/write rates
  • Implement graceful degradation in agent pipelines by monitoring available memory and reducing batch size when resources are constrained

Not For

  • Distributed system monitoring across multiple hosts — use Prometheus node_exporter or Datadog agent for fleet monitoring; psutil is single-host only
  • Container-aware resource monitoring — psutil reads host metrics in containers, not container-scoped cgroup limits; use docker stats API for container resource usage
  • Long-term metrics storage and alerting — psutil is a point-in-time snapshot library; use Prometheus/Grafana for time-series monitoring

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — local Python library. Elevated privileges required for some operations (process memory maps, other users' processes).

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

psutil is open source and free.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Documented

Known Gotchas

  • psutil.process_iter() can raise NoSuchProcess mid-iteration as processes die — always wrap in try/except NoSuchProcess when iterating
  • In Docker containers, psutil reads host system metrics (all CPUs, all memory) not container cgroup limits — cpu_count() returns host CPU count, not container CPU quota
  • CPU percent on first call always returns 0.0 — must call twice with an interval or use per_cpu=True with a sleep between calls to get meaningful readings
  • Memory info types vary by OS — 'rss' is reliable cross-platform; 'vms', 'shared', 'text' are platform-specific and may be 0 on some systems
  • Process.connections() requires elevated privileges on macOS for processes owned by other users — use try/except AccessDenied in agents running as non-root
  • Disk I/O counters (disk_io_counters) may be None on some virtual machines and container environments — always check for None before using

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for psutil.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered