Background Mode
For long-running indexing jobs, use background mode so the process continues even if your SSH connection drops.
# Start in background
drush ost --workers=4 --batch=100 --background
# Check progress anytime
drush oss
# Watch the log file
tail -f /tmp/opensolr_turbo.log
# Stop when needed
drush osstop
📝 Log Location
Background mode writes progress to /tmp/opensolr_turbo.log every 5 seconds.
How Background Mode Works
When you add the --background flag, the indexer:
- Starts a daemon process using
nohup - Detaches from your terminal session
- Writes progress to a log file instead of stdout
- Continues running even if you disconnect
Monitoring Background Jobs
Check Status
Use drush oss to see current progress:
drush oss
=== INDEXING STATISTICS ===
my_solr_index [██████████░░░░░░░░░░] 52.3%
156,432 / 299,123 (remaining: 142,691)
Background indexer running (PID: 12345)
Log: /tmp/opensolr_turbo.log
Active workers: 4
Watch the Log
For detailed real-time progress:
tail -f /tmp/opensolr_turbo.log
The log shows updates every 5 seconds with:
- Current time and elapsed duration
- Number of active workers
- Progress percentage for each index
- Indexing rate (items/second)
- Estimated time remaining (ETA)
Stop Background Indexing
drush osstop
This stops both the master daemon and all worker processes cleanly.
Process Management
Find Running Processes
# Find master process
cat /tmp/opensolr_turbo_master.pid
# List all worker processes
ps aux | grep 'opensolr:worker'
# Count active workers
ps aux | grep 'opensolr:worker' | grep -v grep | wc -l
Emergency Stop
If drush osstop doesn't work:
# Kill master process
kill $(cat /tmp/opensolr_turbo_master.pid)
# Kill all workers
pkill -f 'opensolr:worker'
# Clean up PID files
rm -f /tmp/opensolr_turbo*.pid
⚠️ One Instance Only
Only one background indexer can run at a time. If you try to start another,
you'll see an error with the existing process PID.