đŸ”„ Preheat

Predict. Preload. Perform.

Adaptive readahead daemon for Linux

View on GitHub

Quick Start Guide

Get preheat running and verified in under 5 minutes.


Prerequisites


Step 1: Check Service Status

First, verify preheat is running:

sudo systemctl status preheat

Expected output (service running):

● preheat.service - Adaptive readahead daemon
     Loaded: loaded (/usr/lib/systemd/system/preheat.service; enabled)
     Active: active (running) since Mon 2024-12-15 10:00:00 UTC
   Main PID: 1234 (preheat)
     Memory: 5.2M

If not running, start it:

sudo systemctl start preheat

Or first verify system requirements:

preheat --self-test

Step 2: Verify Daemon Operation

Check the log file to confirm normal operation:

sudo tail -30 /usr/local/var/log/preheat.log

Healthy log output looks like:

[Mon Dec 15 10:00:00 2024] loading configuration from /usr/local/etc/preheat.conf
[Mon Dec 15 10:00:00 2024] loading state from /usr/local/var/lib/preheat/preheat.state
[Mon Dec 15 10:00:00 2024] preheat 1.0.1 started

After a few cycles (20 seconds each by default), you’ll see:

[Mon Dec 15 10:00:20 2024] 47 running processes, 23 tracked applications

Step 3: Use the CLI Tool

Check daemon status programmatically:

preheat-ctl status

Output:

preheat is running (PID 1234)

Dump current statistics to the log:

sudo preheat-ctl dump

Then view:

sudo tail -50 /usr/local/var/log/preheat.log

Step 4: Understand the Learning Period

Preheat needs time to learn your usage patterns:

Timeframe What Happens
First hour Building initial model, minimal predictions
First day Learning primary applications
First week Understanding daily patterns
Ongoing Continuously refining predictions

Note: Preheat doesn’t start from scratch! On first run, it seeds its model from your XDG recently-used files, shell history, and installed browsers. You’ll see benefits immediately.

During the learning period:


Step 5: Verify Preloading is Working

After at least an hour of normal use, check if predictions are happening:

# Force a state dump
sudo preheat-ctl dump

# Check the log for prediction activity  
sudo grep -i "readahead\|preload\|predict" /usr/local/var/log/preheat.log | tail -20

You should see entries indicating file preloading activity.


Quick Command Reference

Task Command
Run diagnostics preheat --self-test
Check if running preheat-ctl status
View preload stats sudo preheat-ctl stats
View memory stats preheat-ctl mem
View tracked apps preheat-ctl predict
Pause preloading sudo preheat-ctl pause 2h
Resume preloading preheat-ctl resume
Export patterns sudo preheat-ctl export ~/backup.json
Start service sudo systemctl start preheat
Stop service sudo systemctl stop preheat
Restart service sudo systemctl restart preheat
View live logs sudo tail -f /usr/local/var/log/preheat.log
Dump stats to log sudo preheat-ctl dump
Force save state sudo preheat-ctl save
Reload config sudo preheat-ctl reload

Default Behavior Explained

Out of the box, preheat uses safe, conservative defaults:

Setting Default Meaning
Scan cycle 20 seconds How often it checks running processes
Memory usage ~25% of free RAM Limit on preloading activity
Autosave 1 hour How often state is saved to disk
Sort strategy Block-based Optimized for HDD seek reduction

These defaults:


What to Expect

Immediate Effects

After Learning (Hours to Days)

Typical Results

Application Type Improvement
Daily-use browsers 40-60% faster cold start
Code editors/IDEs 30-50% faster cold start
Office applications 40-60% faster cold start
Rarely-used apps Little to no improvement

Quick Troubleshooting

Service won’t start

# Check for errors
sudo journalctl -u preheat -n 50

# Check if something else uses the PID file
ls -la /run/preheat.pid

# Try running in foreground for debugging
sudo preheat -f

Log shows errors

# Check configuration syntax
sudo preheat --help

# Verify configuration file
cat /usr/local/etc/preheat.conf

No improvement noticed

See Troubleshooting for detailed problem resolution.


Next Steps

Now that preheat is running:

  1. How It Works - Understand the daemon’s behavior
  2. Configuration - Tune for your specific needs
  3. Advanced Usage - Power-user optimizations

Previous Up Next
← Installation Documentation Index How It Works →