Object storage

From Server rental store
Revision as of 17:39, 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. Object Storage Configuration for MediaWiki 1.40

This article details the configuration of object storage for a MediaWiki 1.40 installation. Utilizing object storage can significantly improve scalability, reliability, and cost-effectiveness for storing uploaded files. This guide assumes basic familiarity with system administration and MediaWiki configuration.

Introduction

Traditionally, MediaWiki stores uploaded files (images, videos, documents, etc.) directly on the server's local filesystem. While this is simple to set up, it can become a bottleneck as the wiki grows. Object storage, such as Amazon S3, Google Cloud Storage, or MinIO, provides a more robust and scalable solution. This enables horizontal scaling and improved data durability. The `wfUploadPath` configuration variable is central to this setup.

Prerequisites

Before configuring object storage, ensure you have the following:

  • A running MediaWiki 1.40 installation. See Manual:Installation guide for details.
  • An account with an object storage provider (e.g., Amazon S3, Google Cloud Storage, MinIO).
  • Appropriate credentials (access key, secret key, bucket name, etc.) for your object storage account. These should be stored securely and never directly in `LocalSettings.php`.
  • PHP extensions required for your chosen object storage provider. For example, the AWS SDK for PHP is needed for Amazon S3. Refer to Manual:Configuration settings for PHP requirements.

Configuration Steps

The primary configuration is done through the `LocalSettings.php` file. We’ll use the following variables:

  • `$wgUploadDirectory`: This variable should *not* point to a local directory when using object storage. It’s still required but is used internally. A temporary directory is needed.
  • `$wgUploadPath`: This variable defines the URL path for uploaded files.
  • `$wgObjectCache`: Consider using an external object cache like Memcached or Redis to improve performance.
  • `$wgUseExternalFiles`: Set to `true` to enable the use of external storage.
  • `$wgHashedUploads`: Enable hashed uploads for better security.

Here's an example using Amazon S3:

```php $wgUploadDirectory = '/tmp/mediawiki-uploads'; //Temporary directory $wgUploadPath = 'https://your-s3-bucket-name.s3.amazonaws.com'; $wgUseExternalFiles = true; $wgHashedUploads = true;

$wgObjectCache = new APCache(); // Or Memcached, Redis, etc. ```

Detailed Technical Specifications

The following tables outline the key technical details for configuring object storage with common providers.

Provider Protocol Authentication Key Features
Amazon S3 HTTPS Access Key ID / Secret Access Key, IAM Roles High Scalability, Durability, Cost-effective
Google Cloud Storage HTTPS Service Account, API Key Global Availability, Integration with Google Cloud Platform
MinIO HTTPS, HTTP Access Key / Secret Key Open Source, Self-Hosted, S3 Compatible
PHP Extension Version Requirement Description
AWS SDK for PHP 3.x or higher Provides access to Amazon S3 services. Install via Composer.
Google Cloud Storage PHP Library Latest Version Provides access to Google Cloud Storage services. Install via Composer.
MinIO PHP SDK Latest Version Provides access to MinIO services. Install via Composer.
Configuration Variable Description Default Value
`$wgUploadDirectory` Temporary directory for uploads before they are moved to object storage. `/tmp`
`$wgUploadPath` URL path to the object storage bucket. (Empty)
`$wgUseExternalFiles` Enables or disables the use of external storage. `false`
`$wgHashedUploads` Enables hashed upload filenames for security. `false`

Important Considerations

  • **Permissions:** Ensure your object storage bucket has the correct permissions set up to allow MediaWiki to upload and access files. Incorrect permissions are a common source of errors. See Manual:Permissions for more details on MediaWiki permissions.
  • **Security:** Protect your object storage credentials. Do not hardcode them directly into `LocalSettings.php`. Use environment variables or a secure configuration management system.
  • **Performance:** Network latency between your MediaWiki server and the object storage provider can impact performance. Choose a provider with a data center close to your server.
  • **Cost:** Object storage costs vary depending on the provider, storage class, and usage. Monitor your usage and choose the appropriate storage class to minimize costs.
  • **CDN Integration:** Consider integrating a Content Delivery Network (CDN) with your object storage to further improve performance and reduce latency for users around the world. This improves Performance significantly.
  • **Error Handling:** Implement robust error handling in your MediaWiki configuration to gracefully handle potential issues with object storage connectivity. Review the Debugging section of the wiki.
  • **File Deletion:** When deleting content from the wiki, ensure that the corresponding files are also deleted from object storage. Consider using a cron job to automatically clean up orphaned files.



Troubleshooting

Common issues include:

  • **Authentication Errors:** Verify your access key and secret key are correct.
  • **Permission Errors:** Check the permissions on your object storage bucket.
  • **Network Connectivity Issues:** Ensure your MediaWiki server can connect to the object storage provider.
  • **PHP Extension Issues:** Verify the required PHP extensions are installed and enabled. Check PHP configuration.



Further Reading


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.* ⚠️