Basic Example: Getting Started with Preheat
A step-by-step walkthrough for new users.
Scenario
You have a laptop with a mechanical hard drive or SATA SSD. Applications like Firefox, VS Code, and other tools take several seconds to start. You want to speed up your daily workflow.
Step 1: Install Preheat
# Install dependencies
sudo apt update
sudo apt install -y build-essential libglib2.0-dev autoconf automake
# Clone and install
git clone https://github.com/wasteddreams/preheat-linux.git
cd preheat-linux
sudo bash setup.sh install
Step 2: Verify Installation
# Check service status
sudo systemctl status preheat
Expected output:
● preheat.service - Adaptive readahead daemon
Loaded: loaded (...; enabled; preset: enabled)
Active: active (running) since ...
Step 3: Use Your System Normally
Just use your computer as you normally would:
- Open Firefox to browse
- Launch VS Code to code
- Start Burp Suite for security testing
- Use the terminal
Preheat is learning in the background.
Step 4: Check Learning Progress (After a Few Hours)
# Dump statistics to log
sudo preheat-ctl dump
# View tracked applications
sudo tail -100 /usr/local/var/log/preheat.log
You should see output like:
[timestamp] 47 running processes, 23 tracked applications
Step 5: Notice the Improvement
After 1-2 days of normal use:
Before preheat: Cold-starting Firefox takes 4-5 seconds.
After preheat learns: Firefox starts in 1-2 seconds because it’s already in the disk cache.
Understanding What Happened
Day 1 (Learning):
Morning: You open Firefox, VS Code, Terminal
Preheat: "User often uses these together, I'll remember that"
Day 2 (Predicting):
Morning: You log in
Preheat: "Based on yesterday, Firefox is likely to be opened"
Preheat: Preloads Firefox into memory
Result: When you click Firefox, it starts instantly
Quick Commands Reference
| Task | Command |
|---|---|
| Check if running | sudo systemctl status preheat |
| View logs | sudo tail -f /usr/local/var/log/preheat.log |
| See statistics | sudo preheat-ctl dump then check log |
| Restart | sudo systemctl restart preheat |
Configuration (Optional)
The default configuration works well. If you want to view it:
cat /usr/local/etc/preheat.conf
See Configuration Reference for customization options.
What’s Next?
- Advanced Example - Power-user configuration
- How It Works - Understand the technology
- Troubleshooting - If something goes wrong
Navigation
| Previous | Up | Next |
|---|---|---|
| ← Troubleshooting | Examples Index | Advanced Example → |