OpenSolr Turbo Indexer

True Parallel Solr Indexing for Drupal 9 / 10 / 11

Files & Logs

File Purpose
/tmp/opensolr_turbo.pids JSON list of active worker PIDs
/tmp/opensolr_turbo_master.pid Background master process PID
/tmp/opensolr_turbo.log Background mode log file

Log File

The log file (/tmp/opensolr_turbo.log) contains detailed progress information:

╔═══════════════════════════════════════════════════════════════╗
║  ⚡ OPENSOLR TURBO INDEXER                                    ║
║  Started: 2024-01-15 14:30:00                                 ║
╚═══════════════════════════════════════════════════════════════╝

┌─ Configuration ─────────────────────────────────────────────┐
│  Server:  my_solr_server
│  Workers: 8 per index
│  Batch:   500 items
└──────────────────────────────────────────────────────────────┘

───────────────────────────────────────────────────────────────
⏱  14:35:00 │ Elapsed: 5m 00s       │ Workers: 8
───────────────────────────────────────────────────────────────
⚡ my_solr_server          [██████░░░░░░░░░░░░░░]  32.1% │    156/s │ ETA: 10m 23s

View Log in Real-Time

tail -f /tmp/opensolr_turbo.log

View Last 100 Lines

tail -n 100 /tmp/opensolr_turbo.log

Search Log for Errors

grep -i error /tmp/opensolr_turbo.log

PID Files

Master PID

Contains the PID of the background master process:

cat /tmp/opensolr_turbo_master.pid
# Output: 12345

Worker PIDs

JSON array of currently active worker PIDs:

cat /tmp/opensolr_turbo.pids
# Output: [12346, 12347, 12348, 12349]

Cleaning Up

If you need to manually clean up after a crash:

# Stop any running processes
drush osstop

# If that doesn't work, force kill
pkill -f 'opensolr:worker'
pkill -f 'opensolr:turbo-daemon'

# Remove stale PID files
rm -f /tmp/opensolr_turbo*.pid

# Optionally clear the log
rm /tmp/opensolr_turbo.log

Log Rotation

The log file can grow large during extended indexing runs. Consider rotating it for long-running jobs:

# Archive current log
mv /tmp/opensolr_turbo.log /tmp/opensolr_turbo.log.1

# The indexer will create a new log file automatically
💡 Persistent Logs
For production use, consider configuring a custom log location that won't be cleared on reboot. Edit the LOG_FILE constant in the module code.