How to Troubleshoot Common Server Issues

From Server rental store
Revision as of 15:12, 15 April 2025 by Admin (talk | contribs) (Automated server configuration article)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. How to Troubleshoot Common Server Issues

This article provides guidance for newcomers on troubleshooting common issues encountered with a MediaWiki 1.40 server. It covers areas like performance, database connectivity, and common error messages. This guide assumes you have basic system administration knowledge and access to the server's command line.

1. Performance Issues

Slow page loads or general unresponsiveness are common problems. Several factors can contribute to this.

1.1 Identifying Bottlenecks

The first step is to determine where the bottleneck lies. Is it the web server (Apache or Nginx), the PHP process, the database (MySQL/MariaDB or PostgreSQL), or the server’s hardware?

  • Web Server Logs: Examine the Apache or Nginx error and access logs for slow requests or errors. See Apache Configuration for log locations.
  • PHP Errors: Check the PHP error logs for warnings or errors. This is configured in `php.ini`. See PHP Configuration for details.
  • Database Queries: Use the database's query log (if enabled) to identify slow-running queries. See Database Administration for enabling query logging.
  • Server Resources: Use tools like `top`, `htop`, or `vmstat` to monitor CPU usage, memory usage, and disk I/O. See System Monitoring for more information.

1.2 Common Performance Solutions

Once the bottleneck is identified, several solutions can be applied.

Problem Solution
High CPU Usage Optimize database queries. Consider caching frequently accessed data. See Caching Strategies. Low Memory Increase PHP memory limit in `php.ini`. Reduce the number of concurrent PHP processes. Slow Database Queries Add indexes to frequently queried database columns. Optimize database configuration (e.g., `my.cnf` for MySQL/MariaDB). Excessive Disk I/O Use faster storage (e.g., SSD). Optimize caching.

2. Database Connectivity Issues

If MediaWiki cannot connect to the database, the site will be unavailable.

2.1 Checking Database Status

Verify the database server is running. Use the appropriate command for your operating system and database type:

  • MySQL/MariaDB: `systemctl status mysql` or `systemctl status mariadb`
  • PostgreSQL: `systemctl status postgresql`

2.2 Verifying Database Credentials

Ensure the database credentials (hostname, username, password, database name) in `LocalSettings.php` are correct. Incorrect credentials are the most common cause of connectivity issues. See LocalSettings.php Configuration for details.

2.3 Firewall Issues

Confirm that the firewall allows connections from the web server to the database server on the appropriate port (typically 3306 for MySQL/MariaDB and 5432 for PostgreSQL). See Firewall Configuration.

Database Type Default Port Connection String Example (LocalSettings.php)
MySQL/MariaDB 3306 `$wgDBserver = 'localhost';` PostgreSQL 5432 `$wgDBserver = 'localhost';`

3. Common Error Messages

Several common error messages indicate specific problems.

3.1 "Fatal error: Allowed memory size of X bytes exhausted"

This indicates that PHP has run out of memory. Increase the `memory_limit` setting in `php.ini`. Restart the web server after making changes. See PHP Configuration.

3.2 "Can't connect to MySQL server on 'localhost'"

This indicates a database connectivity issue. Verify database status, credentials, and firewall settings as described in Section 2.

3.3 "Error: DatabaseError: Table '...' doesn't exist"

This means a required database table is missing. This could be due to a failed upgrade or a corrupted database. Restore a recent database backup or run the `update.php` script (with caution). See Database Maintenance.

3.4 "500 Internal Server Error"

This is a generic error indicating a server-side problem. Examine the web server and PHP error logs for more specific details.

Error Message Possible Cause Solution
Allowed memory size exhausted PHP memory limit too low. Increase `memory_limit` in `php.ini`. Can't connect to MySQL server Database server down, incorrect credentials, or firewall issue. Verify database status, credentials, and firewall. Table doesn't exist Missing database table. Restore from backup or run `update.php`. 500 Internal Server Error Generic server error. Check web server and PHP error logs.

4. Useful Tools & Resources

  • `top` / `htop`:** System resource monitoring.
  • `vmstat`:** Virtual memory statistics.
  • `iostat`:** Disk I/O statistics.
  • `tcpdump` / `wireshark`:** Network packet analysis.
  • Database Query Log:** (MySQL/MariaDB/PostgreSQL) – for identifying slow queries.
  • Web Server Error Logs:** (Apache/Nginx) - for detailed error information.
  • MediaWiki Documentation: Official MediaWiki documentation.
  • PHP Manual: Official PHP documentation.
  • Database Documentation: Documentation for your specific database system.



LocalSettings.php Configuration PHP Configuration Database Administration System Monitoring Apache Configuration Firewall Configuration Caching Strategies Database Maintenance Update Scripts Troubleshooting Extensions Security Best Practices MediaWiki Upgrade Performance Tuning Database Backups Log File Analysis Error Handling Web Server Configuration


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?

⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️