A lightweight, native Linux process manager for controlling CPU affinity and process priorities. Built in C with GTK3 for the GUI and an event-driven daemon for automatic rule application.
Disclaimer: This application was entirely "Vibe-Coded" - developed through AI-assisted programming. While functional and tested, there may be edge cases or improvements that could be made. If you encounter any issues, have suggestions, or want to contribute improvements, please feel free to open an issue or pull request. Your feedback is welcome!
This application modifies low-level process scheduling parameters. Improper use can cause:
- System instability: Pinning critical system processes to too few CPUs can cause freezes or lag
- Application crashes: Some applications expect access to all CPU cores
- Priority inversion: Setting inappropriate priorities can starve important processes
- Real-time priority dangers: Real-time priority (nice -20) can lock up your system if a process runs away
Recommendations:
- Use Test Mode first to verify settings before saving
- Avoid modifying system processes (PID < 1000) unless you know what you're doing
- Don't set Real-time priority on untrusted or unstable applications
- Keep at least 2 CPU cores unassigned as a safety margin
This software was developed with AI assistance ("vibe-coded"). This means:
- Limited real-world testing: Edge cases may not have been thoroughly tested
- Potential for subtle bugs: AI-generated code can have non-obvious issues
- No warranty: Use at your own risk
Recommendations:
- Review the config file (
~/.config/arch-load-manager.json) before enabling the daemon - Monitor system behavior after applying new rules
- Keep backups of working configurations
- Report any issues you encounter
Arch Load Manager lets you:
- Pin processes to specific CPU cores to optimize performance or isolate workloads
- Set process priorities from background (nice 19) to real-time (nice -20)
- Automatically apply rules to new processes via the background daemon
- Save rules by executable path or process name for persistent configuration
- Process Management: View all running processes with real-time CPU and memory usage
- CPU Affinity Control: Pin processes to specific CPU cores
- Priority Management: Set process priorities from Lowest to Real-time
- Automatic Rule Application: Background daemon automatically applies saved rules
- Rule Persistence: Rules saved by executable path or process name
- Test Mode: Try settings without saving
- Apply to Process Family: Apply settings to related processes with the same executable
- Ultra-Lightweight: Daemon uses <0.05% CPU idle, ~2-5MB RAM
- Sortable Columns: Sort by PID, Name, CPU%, or Memory%
- Color-Coded Processes: Green (low), Yellow (medium), Red (high CPU usage)
- Root required for negative nice values: High, Highest, and Real-time priorities require the daemon to be running as root
- Daemon config scope: The systemd service runs as root by default and reads
/root/.config/arch-load-manager.json. To use a user config, you can use the--configflag, run the daemon as that user, or setEnvironment=HOME=/home/USERin the service. - Linux only: Uses Linux-specific APIs (
/proc,sched_setaffinity,inotify) - Process matching: Rules match exact executable paths or process names; no wildcard/regex support
-
arch-load-manager (GTK3 GUI)
- Visual process management interface
- Create and edit rules
- Manual rule application
- Memory: ~20-30MB
- Startup: <100ms
-
arch-load-daemon (Background Service)
- Event-driven with inotify/epoll
- Monitors for new processes
- Auto-applies matching rules
- Hot-reloads configuration
- CPU: <0.05% idle, <0.2% active
- Memory: ~2-5MB
Rules are stored in: ~/.config/arch-load-manager.json
Format:
{
"exe": {
"/usr/bin/firefox": {
"cpus": [0, 1, 2],
"priority": "High",
"mode": "active"
}
},
"name": {
"python3": {
"cpus": [4, 5, 6, 7],
"priority": "Normal",
"mode": "active"
}
}
}The easiest way to install Arch Load Manager on any Linux distribution is using the provided installation script. This script will check for dependencies, build the project, and install all necessary files.
git clone https://github.com/gitporker/Arch-Load-Manager.git
cd Arch-Load-Manager
chmod +x install.sh
./install.shFor Arch Linux and its derivatives (Manjaro, EndeavourOS, etc.), you can use the PKGBUILD to install it as a native package:
git clone https://github.com/gitporker/Arch-Load-Manager.git
cd Arch-Load-Manager
makepkg -siIf you prefer to install manually:
-
Install dependencies:
- GTK3 (e.g.,
libgtk-3-devon Debian/Ubuntu,gtk3on Arch) - JSON-C (e.g.,
libjson-c-devon Debian/Ubuntu,json-con Arch) - UThash (e.g.,
uthash-devon Debian/Ubuntu,uthashon Arch) - Build tools:
gcc,make,pkg-config
- GTK3 (e.g.,
-
Build and Install:
make
sudo make install- Start the daemon:
sudo systemctl enable --now arch-load-daemonPorker Roland - gitporker@gmail.com
Build-time:
- gcc
- make
- pkg-config
- gtk3 development headers
- json-c development headers
- uthash headers
Runtime:
- gtk3
- json-c
Arch Linux:
sudo pacman -S base-devel gtk3 json-c uthash libdbusmenu-gtk3Ubuntu/Debian:
sudo apt install build-essential libgtk-3-dev libjson-c-dev uthash-dev appmenu-gtk3-moduleFedora/RHEL:
sudo dnf install gcc make pkg-config gtk3-devel json-c-devel uthash-devel appmenu-gtk3-moduleLaunch from:
- Application menu: Search for "Arch Load Manager"
- Terminal:
arch-load-manager
- Select a process from the list
- Choose CPU cores by checking/unchecking boxes
- Select priority level from dropdown
- Choose rule type:
- Executable path: Rule applies to specific binary
- Process name: Rule applies to any process with that name
- Click "Apply"
- Test Mode: Apply settings without saving; the daemon skips those PIDs while the GUI is open
- Apply to process family: Also apply to related processes with the same executable
# Start daemon
sudo systemctl start arch-load-daemon
# Enable on boot
sudo systemctl enable arch-load-daemon
# Run manually with custom config
arch-load-daemon --config /path/to/config.jsonEdit ~/.config/cpu_affinity_manager.json manually or use the GUI. The systemd
daemon runs as root by default and reads /root/.config/cpu_affinity_manager.json
unless you override HOME in the service or run the daemon as your user.
The daemon automatically reloads when the file changes. The mode field is
currently always saved as active and ignored by the daemon.
| Priority | Nice Value | Use Case |
|---|---|---|
| Lowest | 19 | Background tasks |
| Low | 10 | Non-critical processes |
| Normal | 0 | Default priority |
| High | -5 | Important applications |
| Highest | -10 | Critical processes |
| Real-time | -20 | Time-sensitive tasks |
Note: Negative nice values require root privileges
- π’ Green: CPU usage 0-30% (low)
- π‘ Yellow: CPU usage 30-70% (medium)
- π΄ Red: CPU usage 70%+ (high)
Click column headers to sort by:
- PID: Process ID
- Process Name: Alphabetically
- CPU %: Percentage of total CPU (all processes sum to ~100%)
- Memory %: Percentage of total RAM
Default: Sorted by CPU% (descending)
- Memory: ~20-30MB
- Startup: <100ms
- Update interval: 500ms
- Updates pause when minimized
- CPU: <0.05% idle (event-driven)
- CPU: <0.2% when applying rules
- Memory: ~2-5MB resident
- Response time: <100ms for new processes
# Check logs
sudo journalctl -u arch-load-daemon
# Check permissions
ls -l /usr/local/bin/arch-load-daemon
# Verify config
cat ~/.config/cpu_affinity_manager.json | jq
sudo cat /root/.config/cpu_affinity_manager.json | jqSetting negative nice values (High, Highest, Real-time) requires root:
- Daemon must run as root (systemd service handles this)
- GUI can only apply these priorities with sudo/pkexec
- Check daemon is running:
systemctl status arch-load-daemon - Verify config file exists and is valid JSON
- Check daemon logs:
journalctl -u arch-load-daemon -f - Ensure process names/paths match exactly
Some processes may not be accessible due to permissions. Run GUI with sudo to see all:
sudo arch-load-manager# Using uninstall script
chmod +x uninstall.sh
./uninstall.sh
# Or manually
sudo make uninstallThis removes:
- Binaries from
/usr/local/bin/ - Systemd service
- Desktop entry
- Optionally, user configuration
# Clone repository
git clone https://github.com/yourusername/arch-load-manager.git
cd arch-load-manager
# Build
make all
# Build only GUI
make gui
# Build only daemon
make daemon
# Clean build artifacts
make clean
# View help
make helparch-load-manager/
βββ common.h # Shared definitions
βββ config.h # Config management header
βββ config.c # Config implementation (json-c)
βββ arch-load-manager.c # GTK3 GUI application
βββ arch-load-daemon.c # Background daemon
βββ Makefile # Build system
βββ install.sh # Installation script
βββ uninstall.sh # Removal script
βββ README.md # This file
- C11 standard
- Optimized with
-O3 -march=native - Wall, Wextra enabled
- Event-driven architecture
- Zero-copy where possible
MIT License - See LICENSE file for details
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Development: AI-assisted "Vibe-Coded" with Claude
- UI Design: Dark theme inspired by modern desktop aesthetics
- Libraries: GTK3, json-c, uthash
- System: Linux kernel process management APIs (
sched_setaffinity,setpriority,inotify,epoll)
Current version: 1.0.0
This project is open to improvements! If you find bugs, have feature requests, or want to contribute:
- Open an issue to report problems or suggest features
- Submit a pull request with your improvements
- Share your feedback - it helps make the app better for everyone