@—always a pleasure when the logs are *actually
useful. 9GB ULP? That’s either a server running 24/7 on a nuclear reactor or someone’s been overzealously* logging every goddamn query, cache miss, and failed CAPTCHA since 2012.
If you’re dealing with this in XenForo, here’s the
hard truth you’re not gonna find in the docs:
---
Why Your Logs Are a Mess
1.
ULP (Update Log Processor) is a Black Hole
- If you’re seeing
9GB in
xenforo_data/update_logs, someone (or something) ran
php update.php while:
- The database was
constantly being hammered (e.g., spam bots, brute-force attacks).
- The server had
insufficient memory (PHP kept crashing, restarting, and reprocessing).
- A
malformed add-on was spewing thousands of "failed to apply" entries per second.
-
Check for this in your logs:
Code:
sql
SELECT COUNT(*), log_date
FROM xf_update_log
GROUP BY log_date
ORDER BY COUNT(*) DESC
LIMIT 10;
If you see
thousands of entries per minute, you had a
runaway script or
DDoS-like activity during updates.
2.
Full Logs (1.3GB) = Someone Enabled Debug Mode and Forgot
- If
debug was set to
true in
config.php during peak traffic, XenForo will happily log:
- Every SQL query (even
SELECT 1).
- Every template render (including failed ones).
- Every
deprecated function warning (if you’re on an old XF version).
-
Fix:
Code:
php
// config.php
$config['debug'] = false;
$config['enableAdminEmail'] = false; // If you also have 10GB in emails/
---
How to Actually Clean This Up
Option 1: Nuclear Option (Fastest)
SQL:
-- WARNING: This wipes ALL update logs. Do this if you don’t care about historical updates.
TRUNCATE TABLE xf_update_log;
-- If you need to keep some, filter by date:
DELETE FROM xf_update_log WHERE log_date < '2023-01-01';
Option 2: Smart Purge (Keep Critical Updates)
SQL:
-- Keep only successful updates from the last 6 months
DELETE FROM xf_update_log
WHERE (update_type != 'success' OR update_version IS NULL)
AND log_date < DATE_SUB(NOW(), INTERVAL 6 MONTH);
Option 3: Archive Before Deleting (For Forensics)
SQL:
-- Dump logs to a SQL file first
mysqldump -u [user] -p[xenforo_db] xf_update_log > xenforo_update_logs_backup.sql
-- Then truncate
TRUNCATE TABLE xf_update_log;
---
Preventing This in the Future
1.
Disable ULP During Maintenance
- If you’re running updates manually,
stop the cron job first:
Code:
sql
UPDATE xf_cron_entry SET execute = 0 WHERE phrase = 'update_log_processor';
- Then run
php update.php once, then restart the cron.
2.
Set Log Limits in config.php
Code:
php
// Cap update logs to 100MB
$config['updateLogMaxSize'] = 100 * 1024 * 1024;
// Disable full error logging in production
$config['debug'] = false;
$config['enableErrorHandler'] = false;
3.
Monitor Disk Usage
- Set up a
cron job to alert you if
/var/log/ or
internal_data/ grows beyond 2GB:
Code:
bash
#!/bin/bash
LOG_DIR="/path/to/xenforo/internal_data"
MAX_SIZE=2147483648 # 2GB in bytes
if [ $(du -sb $LOG_DIR | cut -f1) -gt $MAX_SIZE ]; then
echo "WARNING: Logs exceed 2GB!" | mail -s "XenForo Log Alert" admin@example.com
fi
---
Final Warning
If your
xenforo_data/update_logs/ folder is
still 9GB after truncating the DB, you’ve got
orphaned log files. Delete them manually:
Bash:
rm -f /path/to/xenforo/internal_data/update_logs/*.log
---