Skip to content

Performance Optimization

Improve your Debian 13 system's performance with these optimization techniques and tips.

🚀 System Performance

CPU Optimization

bash
# Check CPU information
lscpu
cat /proc/cpuinfo

# Monitor CPU usage
htop
top

# CPU frequency scaling
sudo apt install cpufrequtils
sudo cpufreq-info

Memory Management

bash
# Check memory usage
free -h
cat /proc/meminfo

# Monitor memory
sudo apt install htop
htop

# Clear cache
sudo sync
echo 3 | sudo tee /proc/sys/vm/drop_caches

💾 Storage Performance

Disk Optimization

bash
# Check disk usage
df -h
du -sh /*

# Monitor disk I/O
sudo apt install iotop
sudo iotop

# Disk performance test
sudo apt install hdparm
sudo hdparm -Tt /dev/sda

SSD Optimization

bash
# Enable TRIM
sudo systemctl enable fstrim.timer

# Check TRIM support
lsblk -D

# Manual TRIM
sudo fstrim -av

🎨 Desktop Performance

Lightweight Desktop Environments

bash
# Install lightweight desktops
sudo apt install xfce4          # Xfce
sudo apt install lxde           # LXDE
sudo apt install lxqt           # LXQt

# Minimal window managers
sudo apt install openbox        # Openbox
sudo apt install i3             # i3wm

Disable Visual Effects

bash
# GNOME: Disable animations
gsettings set org.gnome.desktop.interface enable-animations false

# Install GNOME Tweaks for more options
sudo apt install gnome-tweaks

# Disable compositor in Xfce
xfconf-query -c xfwm4 -p /general/use_compositing -s false

🔧 System Services

Service Management

bash
# List running services
systemctl list-units --type=service --state=running

# Disable unnecessary services
sudo systemctl disable service-name
sudo systemctl stop service-name

# Common services to consider disabling:
# bluetooth (if not needed)
# cups (if no printer)
# ModemManager (if no modem)

Startup Applications

bash
# List autostart applications
ls ~/.config/autostart/
ls /etc/xdg/autostart/

# Disable startup applications
# Edit .desktop files or use desktop settings

📊 Monitoring Tools

System Monitoring

bash
# Install monitoring tools
sudo apt install htop iotop nethogs

# System information
sudo apt install neofetch
neofetch

# Resource monitoring
htop                    # Process monitor
iotop                   # Disk I/O monitor
nethogs                 # Network usage

Performance Benchmarks

bash
# CPU benchmark
sudo apt install sysbench
sysbench cpu run

# Memory benchmark
sysbench memory run

# Disk benchmark
sysbench fileio prepare
sysbench fileio run

⚡ Quick Performance Tips

Immediate Improvements

  1. Close Unused Applications: Free up RAM
  2. Restart System: Clear memory leaks
  3. Clean Temporary Files: Free disk space
  4. Update System: Get performance improvements
bash
# Clean system
sudo apt autoremove
sudo apt autoclean
sudo apt clean

# Clear temporary files
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*

Browser Optimization

bash
# Firefox optimization
# about:config settings:
browser.cache.disk.enable = false
browser.sessionstore.restore_on_demand = true

# Install ad blocker
# Use fewer browser extensions
# Clear browser cache regularly

🔋 Power Management

Laptop Optimization

bash
# Install TLP for power management
sudo apt install tlp tlp-rdw

# Enable TLP
sudo systemctl enable tlp
sudo systemctl start tlp

# Check TLP status
sudo tlp-stat

CPU Scaling

bash
# Install cpufrequtils
sudo apt install cpufrequtils

# Set CPU governor
sudo cpufreq-set -g powersave    # Power saving
sudo cpufreq-set -g performance  # Performance
sudo cpufreq-set -g ondemand     # Balanced

🗄️ File System Optimization

File System Tuning

bash
# Check file system
sudo tune2fs -l /dev/sda1

# Optimize ext4
sudo tune2fs -o journal_data_writeback /dev/sda1

# Mount options for performance
# In /etc/fstab:
/dev/sda1 / ext4 defaults,noatime 0 1

Cleanup and Maintenance

bash
# Find large files
sudo find / -size +100M -type f 2>/dev/null

# Clean package cache
sudo apt clean
sudo apt autoremove

# Remove old kernels
sudo apt autoremove --purge

🎯 Performance Profiles

Gaming Performance

bash
# Set performance CPU governor
sudo cpufreq-set -g performance

# Disable swap (if enough RAM)
sudo swapoff -a

# Close unnecessary services
sudo systemctl stop bluetooth
sudo systemctl stop cups

Server Performance

bash
# Minimal desktop or headless
# Disable GUI: sudo systemctl set-default multi-user.target

# Optimize for server workloads
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
echo 'vm.dirty_ratio=15' | sudo tee -a /etc/sysctl.conf

Performance optimized? Return to system configuration →

基于 MIT 许可发布