Preventative Maintenance
- Preventative Maintenance
This article details preventative maintenance procedures for MediaWiki servers. Regular maintenance is crucial for ensuring optimal performance, data integrity, and minimizing downtime. This guide is aimed at system administrators and those responsible for managing a MediaWiki installation. We will cover database maintenance, file system checks, log rotation, and backup strategies. It is assumed you have root access to the server and a working knowledge of the command line.
Database Maintenance
The database is the heart of your MediaWiki installation. Neglecting database maintenance can lead to performance degradation and even data loss. We'll focus on MySQL/MariaDB, the most common database backend.
Regular Optimization
Regularly optimizing tables reduces fragmentation and improves query performance. This can be automated using a cron job.
Command | Description |
---|---|
`mysqlcheck -o <database_name>` | Optimizes all tables in the specified database. Replace `<database_name>` with your MediaWiki database name. |
`mysqlcheck -o -a <database_name>` | Optimizes all tables and performs an analysis. This provides more detailed information about table health. |
`OPTIMIZE TABLE <table_name>` | Optimizes a specific table. Useful for tables experiencing high write activity. |
Remember to schedule these tasks during off-peak hours to minimize impact on users. See Special:DatabaseReports for database statistics.
Database Backups
Regular backups are essential for disaster recovery. Implement a robust backup strategy that includes both full and incremental backups. Consider using tools like `mysqldump` or `mariadb-dump`.
Backup Type | Description | Frequency |
---|---|---|
Full Backup | Creates a complete copy of the database. | Weekly |
Incremental Backup | Backs up only the changes made since the last full or incremental backup. | Daily |
Binary Backup (using `xtrabackup`) | Creates a physical copy of the database files. Faster restoration. | Weekly |
Test your backups regularly to ensure they are restorable! Consult the Backups page for detailed instructions.
Database User Privileges
Review database user privileges regularly. Ensure the MediaWiki user has only the necessary permissions. Restricting unnecessary access improves security. See Configuring database access for details.
File System Maintenance
Maintaining the file system ensures that MediaWiki can access its files efficiently.
Disk Space Monitoring
Monitor disk space usage regularly. A full disk can cause serious problems. Use commands like `df -h` to check disk space. Implement alerts to notify you when disk space is running low. See Server Monitoring Tools for options.
File System Checks
Run file system checks (using `fsck`) periodically to detect and repair errors. Schedule this during downtime.
File System Type | Check Command | Notes |
---|---|---|
ext4 | `fsck -f /dev/<device>` | Replace `<device>` with the appropriate device name. |
XFS | `xfs_repair /dev/<device>` | Requires unmounting the file system first. |
Log Rotation
Log files can grow rapidly, consuming disk space. Configure log rotation to automatically archive and delete old logs.
Logrotate Configuration
The `logrotate` utility is commonly used for log rotation. Configure it to rotate MediaWiki logs (e.g., error logs, access logs) and archive them. The configuration file is typically located at `/etc/logrotate.d/mediawiki`. Example configuration:
``` /var/log/mediawiki/error.log {
rotate 7 daily missingok notifempty compress delaycompress copytruncate
} ```
Backup Strategies
A comprehensive backup strategy is crucial. Consider the 3-2-1 rule: 3 copies of your data, on 2 different media, with 1 offsite.
Backup Types
- Full Backups: Complete copies of all data. Slowest to create but fastest to restore.
- Differential Backups: Back up all changes since the last *full* backup. Faster than full backups, but slower to restore.
- Incremental Backups: Back up all changes since the last *incremental* or *full* backup. Fastest to create, slowest to restore.
Backup Locations
- Local Disk: Quick and easy, but vulnerable to hardware failure.
- Network Attached Storage (NAS): Provides redundancy and accessibility.
- Offsite Storage (Cloud or Physical): Protects against disasters affecting your primary location. See Disaster Recovery Planning.
Security Considerations
Regular maintenance also includes security audits and updates. Keep your server software and MediaWiki installation up to date with the latest security patches. See Security Best Practices for more information. Review Extension Security to ensure extensions are maintained.
Scheduling Maintenance
Use a cron job scheduler to automate maintenance tasks. Schedule tasks during off-peak hours to minimize impact on users. See Cron Jobs for more information.
Special:MyPreferences can affect how maintenance is perceived by administrators. Regularly check the MediaWiki release calendar for updates. Remember to consult the Installation guide for initial setup.
Intel-Based Server Configurations
Configuration | Specifications | Benchmark |
---|---|---|
Core i7-6700K/7700 Server | 64 GB DDR4, NVMe SSD 2 x 512 GB | CPU Benchmark: 8046 |
Core i7-8700 Server | 64 GB DDR4, NVMe SSD 2x1 TB | CPU Benchmark: 13124 |
Core i9-9900K Server | 128 GB DDR4, NVMe SSD 2 x 1 TB | CPU Benchmark: 49969 |
Core i9-13900 Server (64GB) | 64 GB RAM, 2x2 TB NVMe SSD | |
Core i9-13900 Server (128GB) | 128 GB RAM, 2x2 TB NVMe SSD | |
Core i5-13500 Server (64GB) | 64 GB RAM, 2x500 GB NVMe SSD | |
Core i5-13500 Server (128GB) | 128 GB RAM, 2x500 GB NVMe SSD | |
Core i5-13500 Workstation | 64 GB DDR5 RAM, 2 NVMe SSD, NVIDIA RTX 4000 |
AMD-Based Server Configurations
Configuration | Specifications | Benchmark |
---|---|---|
Ryzen 5 3600 Server | 64 GB RAM, 2x480 GB NVMe | CPU Benchmark: 17849 |
Ryzen 7 7700 Server | 64 GB DDR5 RAM, 2x1 TB NVMe | CPU Benchmark: 35224 |
Ryzen 9 5950X Server | 128 GB RAM, 2x4 TB NVMe | CPU Benchmark: 46045 |
Ryzen 9 7950X Server | 128 GB DDR5 ECC, 2x2 TB NVMe | CPU Benchmark: 63561 |
EPYC 7502P Server (128GB/1TB) | 128 GB RAM, 1 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (128GB/2TB) | 128 GB RAM, 2 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (128GB/4TB) | 128 GB RAM, 2x2 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (256GB/1TB) | 256 GB RAM, 1 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (256GB/4TB) | 256 GB RAM, 2x2 TB NVMe | CPU Benchmark: 48021 |
EPYC 9454P Server | 256 GB RAM, 2x2 TB NVMe |
Order Your Dedicated Server
Configure and order your ideal server configuration
Need Assistance?
- Telegram: @powervps Servers at a discounted price
⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️