When configuring a VPS for WordPress with supporting services, we need to account for:
- Apache: Memory footprint depends on number of concurrent connections
- WordPress: PHP memory requirements plus plugin overhead
- MySQL: Default configuration typically uses 20-30% of available RAM
- SVN: Minimal memory usage for version control operations
For your described low-traffic scenario (<1k hits/day), here's a practical breakdown:
# Typical memory usage breakdown (MB)
Apache: 100-150
PHP-FPM: 50-80
MySQL: 150-200
SVN: 10-20
OS overhead: 50-100
A 1GB RAM VPS would be the absolute minimum, but I strongly recommend:
- 2GB RAM: Comfortable baseline for this stack
- With swap space: 1-2GB swap helps handle occasional spikes
- Apache tuning:
# Sample Apache MPM prefork configuration
StartServers 2
MinSpareServers 2
MaxSpareServers 5
MaxRequestWorkers 30
MaxConnectionsPerChild 1000
For a WordPress-specific MySQL setup:
# my.cnf optimizations
[mysqld]
key_buffer_size = 32M
table_open_cache = 400
innodb_buffer_pool_size = 128M
query_cache_size = 32M
max_connections = 30
Install these tools to verify real memory consumption:
sudo apt install htop mytop
htop # For overall system monitoring
mytop -u root -p # For MySQL-specific monitoring
Monitor these metrics to determine if you need more RAM:
- Consistently >80% memory usage
- Frequent swapping (visible in htop)
- MySQL creating temporary tables on disk
For a typical LAMP stack running WordPress with SVN on low-traffic sites (<1k daily hits), here's the RAM breakdown:
# Typical process memory footprint (in MB):
Apache: 100-150 (with 2-3 sites + SSL)
MySQL: 200-250 (single WP database)
WordPress: 50-70 (PHP-FPM)
SVN: 20-30 (basic repository access)
System overhead: 50-100
Here's a working Apache virtual host configuration for this setup:
<VirtualHost *:443>
ServerName example.com
DocumentRoot /var/www/wordpress
SSLEngine on
SSLCertificateFile /etc/ssl/certs/example.crt
SSLCertificateKeyFile /etc/ssl/private/example.key
<Directory /var/www/wordpress>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# SVN configuration
<Location /svn>
DAV svn
SVNPath /var/svn/repos
AuthType Basic
AuthName "SVN Repository"
AuthUserFile /etc/svn-auth-file
Require valid-user
</Location>
</VirtualHost>
For MySQL configuration in /etc/mysql/my.cnf:
[mysqld]
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
max_connections = 25
table_open_cache = 64
query_cache_limit = 1M
query_cache_size = 16M
innodb_buffer_pool_size = 64M
The sweet spot for this configuration is 1GB RAM (non-burstable). Here's why:
- 512MB would work but leaves no headroom for traffic spikes
- 768MB is comfortable for steady-state operation
- 1GB provides buffer for concurrent SVN operations and WP plugin overhead
Use this Bash script to monitor memory usage:
#!/bin/bash
watch -n 60 'free -m && \
ps -eo pid,user,%mem,command --sort=-%mem | head -10 && \
mysqladmin processlist'
If you consistently see swap usage or OOM kills, consider upgrading to 1.5GB or optimizing your configuration further.