Welcome to gopsutil
gopsutil is a Go port of psutil, providing a cross-platform library to retrieve process and system utilization information including CPU, memory, disks, network, sensors, and processes.Quick Start
Get started with gopsutil in minutes
API Reference
Explore the complete API documentation
Platform Support
View supported platforms and architectures
Examples
Learn with practical examples
Key Features
Cross-Platform
Works on Linux, Windows, macOS, FreeBSD, OpenBSD, and Solaris
Pure Go
Implemented without cgo, porting C structs to Go
Rich Metrics
CPU, memory, disk, network, process, and sensor information
Context Support
Full context.Context support for cancellation and timeouts
Supported Platforms
gopsutil supports a wide range of operating systems and architectures:- Linux: i386, amd64, arm, arm64
- Windows: i386, amd64, arm, arm64
- macOS: amd64 (Intel), arm64 (Apple Silicon)
- FreeBSD: i386, amd64, arm, arm64
- OpenBSD: i386, amd64, armv7, arm64, riscv64
- Solaris: amd64 (SmartOS/Illumos)
Partial support is available for CPU on DragonFly BSD and host information on Linux RISC-V.
Why gopsutil?
No CGO Dependencies
No CGO Dependencies
All functionality is implemented in pure Go without requiring cgo. This means easier cross-compilation and no C toolchain dependencies.
Battle-Tested
Battle-Tested
Based on the proven psutil library with over 11,000+ GitHub stars and used in production by thousands of applications.
Actively Maintained
Actively Maintained
Regular monthly releases with Calendar Versioning (CalVer) ensuring you always get the latest platform support and bug fixes.
Comprehensive Coverage
Comprehensive Coverage
From basic CPU and memory stats to advanced features like Docker container monitoring and Windows services management.
Quick Example
Here’s a simple example to get you started:What’s New in v4
gopsutil v4 introduces several improvements and breaking changes. See the v4 migration guide for details.
- Platform-specific extended information via
Exstructs - Enhanced error handling and consistency
- Improved context support across all packages
- Better caching mechanisms for performance
Next Steps
Install gopsutil
Follow the installation guide to add gopsutil to your project
Try the quickstart
Work through the quickstart guide to build your first monitoring application
Explore the API
Dive into the API reference to discover all available packages and functions