测试环境:1核CPU / 1GB内存 / 30GB SSD / 5Mbps带宽
系统:Ubuntu 22.04 LTS / Nginx 1.24 / PHP 8.1-FPM / MySQL 8.0
测试对象:WordPress 6.6 / Emlog Pro 2.6.27 / Typecho 1.2.1
一、为什么测这三个?
国内个人站长建站,绕不开这三个选择:
┌─────────────┬────────────────────────┬──────────────────────────┐
│ 系统 │ 定位 │ 典型用户画像 │
├─────────────┼────────────────────────┼──────────────────────────┤
│ WordPress │ 全球第一,生态庞大 │ 功能要求高,愿意折腾插件 │
│ Emlog │ 国产轻量,上手简单 │ 中文用户,追求开箱即用 │
│ Typecho │ 极简主义,极客偏好 │ 开发者,喜欢自己写主题 │
└─────────────┴────────────────────────┴──────────────────────────┘
但「轻量」是主观感受,到底谁更吃 CPU?谁更吃内存?谁的数据库查询更多? 本文用同一台 1核1G 的 VPS,给出可直接复现的对比数据。
二、测试环境统一搭建
# 基础环境(三个系统共用同一套 LNMP)
sudo apt update
sudo apt install -y nginx mysql-server php8.1-fpm \
php8.1-mysql php8.1-xml php8.1-mbstring php8.1-gd \
php8.1-curl php8.1-zip php8.1-bcmath php8.1-intl
# 创建三个数据库
sudo mysql -e "CREATE DATABASE wp_db; CREATE DATABASE em_db; CREATE DATABASE tp_db;"
sudo mysql -e "CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'pass';"
sudo mysql -e "CREATE USER 'em_user'@'localhost' IDENTIFIED BY 'pass';"
sudo mysql -e "CREATE USER 'tp_user'@'localhost' IDENTIFIED BY 'pass';"
sudo mysql -e "GRANT ALL PRIVILEGES ON wp_db.* TO 'wp_user'@'localhost';"
sudo mysql -e "GRANT ALL PRIVILEGES ON em_db.* TO 'em_user'@'localhost';"
sudo mysql -e "GRANT ALL PRIVILEGES ON tp_db.* TO 'tp_user'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
2.1 Nginx 统一配置模板
三个站点分别监听不同端口,避免互相干扰:
# /etc/nginx/sites-available/wordpress
server {
listen 8081;
root /var/www/wordpress;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}
# /etc/nginx/sites-available/emlog
server {
listen 8082;
root /var/www/emlog;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}
# /etc/nginx/sites-available/typecho
server {
listen 8083;
root /var/www/typecho;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}
sudo nginx -t && sudo systemctl restart nginx
三、安装与初始资源占用
3.1 安装命令
# WordPress 6.6
cd /var/www
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo chown -R www-data:www-data wordpress
# Emlog Pro 2.6.27
wget https://www.emlog.net/download/emlog_pro_2.6.27.zip
unzip emlog_pro_2.6.27.zip -d emlog
sudo chown -R www-data:www-data emlog
# Typecho 1.2.1
wget https://github.com/typecho/typecho/releases/download/v1.2.1/typecho.zip
unzip typecho.zip -d typecho
sudo chown -R www-data:www-data typecho
3.2 安装后磁盘占用对比
du -sh /var/www/wordpress
du -sh /var/www/emlog
du -sh /var/www/typecho
┌─────────────┬────────────┬─────────────────────────────────┐
│ 系统 │ 磁盘占用 │ 说明 │
├─────────────┼────────────┼─────────────────────────────────┤
│ WordPress │ 68.4 MB │ 自带主题+插件目录,文件数量庞大 │
│ Emlog │ 19.2 MB │ 精简结构,无冗余依赖 │
│ Typecho │ 8.6 MB │ 极简内核,仅核心文件 │
└─────────────┴────────────┴─────────────────────────────────┘
Typecho 的体积只有 WordPress 的 1/8。
四、空站内存占用对比
安装完成后,不添加任何内容,仅访问首页一次,记录系统内存占用:
# 重启所有服务,清空缓存
sudo systemctl restart nginx php8.1-fpm mysql
# 分别访问三个站点首页
curl -s http://localhost:8081/ > /dev/null
curl -s http://localhost:8082/ > /dev/null
curl -s http://localhost:8083/ > /dev/null
# 记录内存
free -m
ps aux | grep -E "nginx|php-fpm|mysqld" | grep -v grep
┌─────────────┬──────────────┬──────────────┬──────────────┐
│ 系统 │ PHP-FPM内存 │ MySQL内存 │ 总内存占用 │
├─────────────┼──────────────┼──────────────┼──────────────┤
│ WordPress │ 210 MB │ 420 MB │ 850 MB │
│ Emlog │ 180 MB │ 410 MB │ 780 MB │
│ Typecho │ 150 MB │ 395 MB │ 720 MB │
└─────────────┴──────────────┴──────────────┴──────────────┘
┌─────────────────────────────────────────────────────────────┐
│ 空站状态分析: │
│ - WordPress 加载了更多函数和钩子,PHP 内存占用最高 │
│ - MySQL 差异主要来自 WordPress 的 options 表预加载更多数据 │
│ - Typecho 内核精简,内存基线最低 │
└─────────────────────────────────────────────────────────────┘
五、首页数据库查询对比
在首页模板底部插入查询计数代码,统计首页渲染时的数据库查询次数:
// WordPress: 在 footer.php 添加
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds
// Emlog: 在模板 footer.php 添加
<?php echo $DB->query_count; ?> queries
// Typecho: 在 footer.php 添加
<?php echo $this->db->getQueryNum(); ?> queries
┌─────────────┬──────────────┬──────────────┬──────────────────────┐
│ 系统 │ 首页查询数 │ 渲染时间 │ 查询特征 │
├─────────────┼──────────────┼──────────────┼──────────────────────┤
│ WordPress │ 28 条 │ 0.18s │ options表反复查询 │
│ Emlog │ 14 条 │ 0.09s │ 单次聚合查询为主 │
│ Typecho │ 9 条 │ 0.06s │ 极简查询,无冗余 │
└─────────────┴──────────────┴──────────────┴──────────────────────┘
WordPress 首页查询数是 Typecho 的 3 倍,主要花在 wp_options 表的自动加载和主题自定义查询上。
六、默认配置并发压测
统一使用 wrk,100 并发,持续 30 秒,测试三个系统的首页:
# WordPress
wrk -t4 -c100 -d30s --latency http://localhost:8081/
# Emlog
wrk -t4 -c100 -d30s --latency http://localhost:8082/
# Typecho
wrk -t4 -c100 -d30s --latency http://localhost:8083/
6.1 WordPress 默认配置结果
Running 30s test @ http://localhost:8081/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.15s 680.20ms 5.20s 78.40%
Req/Sec 11.50 5.30 32.00 62.10%
Latency Distribution
50% 1.95s
75% 2.50s
90% 3.20s
99% 4.80s
1380 requests in 30.20s, 12.80MB read
Socket errors: connect 0, read 0, write 0, timeout 12
Requests/sec: 45.70
Transfer/sec: 433.80KB
6.2 Emlog 默认配置结果
Running 30s test @ http://localhost:8082/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.42s 450.60ms 3.80s 74.20%
Req/Sec 17.80 7.80 45.00 66.50%
Latency Distribution
50% 1.28s
75% 1.65s
90% 2.10s
99% 3.40s
2050 requests in 30.15s, 17.20MB read
Requests/sec: 68.00
Transfer/sec: 584.30KB
6.3 Typecho 默认配置结果
Running 30s test @ http://localhost:8083/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 980.50ms 320.40ms 2.60s 76.80%
Req/Sec 25.20 10.50 55.00 68.30%
Latency Distribution
50% 880.00ms
75% 1.15s
90% 1.45s
99% 2.30s
2860 requests in 30.10s, 18.60MB read
Requests/sec: 95.00
Transfer/sec: 632.80KB
6.4 默认配置对比汇总
┌─────────────┬────────┬──────────┬──────────┬──────────┬──────────┐
│ 系统 │ QPS │ 平均延迟 │ 99%延迟 │ 内存峰值 │ 超时数 │
├─────────────┼────────┼──────────┼──────────┼──────────┼──────────┤
│ WordPress │ 46 │ 2.15s │ 4.80s │ 990MB │ 12 │
│ Emlog │ 68 │ 1.42s │ 3.40s │ 960MB │ 0 │
│ Typecho │ 95 │ 0.98s │ 2.30s │ 910MB │ 0 │
└─────────────┴────────┴──────────┴──────────┴──────────┴──────────┘
┌─────────────────────────────────────────────────────────────┐
│ 默认配置结论: │
│ - Typecho QPS 是 WordPress 的 2.1 倍 │
│ - WordPress 在 100 并发下已出现超时,内存逼近 OOM │
│ - Emlog 介于两者之间,符合"比 WP 轻"的口碑 │
└─────────────────────────────────────────────────────────────┘
七、10篇文章后的真实场景测试
空站数据不够真实。分别在三个系统发布 10 篇带图文章(每篇 3 张图片 + 1000 字),再测一次:
# 统一压测文章列表页
wrk -t4 -c100 -d30s --latency http://localhost:8081/page/2/
wrk -t4 -c100 -d30s --latency http://localhost:8082/page/2/
wrk -t4 -c100 -d30s --latency http://localhost:8083/page/2/
┌─────────────┬────────┬──────────┬──────────┬────────────────────┐
│ 系统 │ QPS │ 平均延迟 │ 99%延迟 │ 数据库查询数 │
├─────────────┼────────┼──────────┼──────────┼────────────────────┤
│ WordPress │ 38 │ 2.55s │ 5.20s │ 35 条 │
│ Emlog │ 62 │ 1.55s │ 3.60s │ 18 条 │
│ Typecho │ 88 │ 1.05s │ 2.50s │ 12 条 │
└─────────────┴────────┴──────────┴──────────┴────────────────────┘
内容越多,WordPress 的查询膨胀越明显(从 28 条涨到 35 条),而 Typecho 仅增加 3 条。
八、后台管理界面资源消耗
同时打开三个系统的后台,记录 5 分钟内的平均 CPU 占用:
# 监控脚本
while true; do
ps -C php-fpm -o pid,ppid,%cpu,rss,comm | grep -v "PID" >> cpu_log.txt
sleep 1
done
┌─────────────┬──────────────┬──────────────┬──────────────────────────┐
│ 系统 │ 后台CPU占用 │ 后台内存占用 │ 主要消耗点 │
├─────────────┼──────────────┼──────────────┼──────────────────────────┤
│ WordPress │ 32% - 45% │ 280MB │ 仪表盘小部件、心跳API │
│ Emlog │ 15% - 22% │ 190MB │ 编辑器、附件管理 │
│ Typecho │ 8% - 12% │ 140MB │ 纯文本编辑器,无冗余 │
└─────────────┴──────────────┴──────────────┴──────────────────────────┘
WordPress 后台的 admin-ajax.php 心跳机制会持续消耗 CPU,即使你不操作页面。
关闭方法:
// WordPress: wp-config.php
define('WP_POST_REVISIONS', false);
define('AUTOSAVE_INTERVAL', 300);
// functions.php 添加
add_action('init', function() {
wp_deregister_script('heartbeat');
}, 1);
九、统一优化后的极限对比
对三个系统应用同一套优化方案(OPcache + PHP-FPM static + MySQL 瘦身):
; /etc/php/8.1/fpm/pool.d/www.conf
[www]
pm = static
pm.max_children = 15
php_admin_value[memory_limit] = 128M
; OPcache
opcache.memory_consumption=64
opcache.max_accelerated_files=4000
; MySQL
innodb_buffer_pool_size = 128M
max_connections = 30
performance_schema = off
sudo systemctl restart php8.1-fpm mysql nginx
9.1 优化后压测结果
wrk -t4 -c100 -d30s --latency http://localhost:8081/
wrk -t4 -c100 -d30s --latency http://localhost:8082/
wrk -t4 -c100 -d30s --latency http://localhost:8083/
┌─────────────┬────────┬──────────┬──────────┬──────────┬──────────┐
│ 系统 │ QPS │ 平均延迟 │ 99%延迟 │ 内存占用 │ 提升幅度 │
├─────────────┼────────┼──────────┼──────────┼──────────┼──────────┤
│ WordPress │ 175 │ 480ms │ 1.20s │ 720MB │ +283% │
│ Emlog │ 295 │ 320ms │ 850ms │ 680MB │ +334% │
│ Typecho │ 385 │ 240ms │ 600ms │ 640MB │ +305% │
└─────────────┴────────┴──────────┴──────────┴──────────┴──────────┘
9.2 优化后极限并发测试(200并发)
wrk -t4 -c200 -d30s http://localhost:8081/
wrk -t4 -c200 -d30s http://localhost:8082/
wrk -t4 -c200 -d30s http://localhost:8083/
┌─────────────┬────────┬──────────┬──────────────────────────────┐
│ 系统 │ QPS │ 失败率 │ 状态 │
├─────────────┼────────┼──────────┼──────────────────────────────┤
│ WordPress │ 142 │ 8% │ 502错误增多,CPU100% │
│ Emlog │ 268 │ 2% │ 偶现502,基本可用 │
│ Typecho │ 350 │ 0% │ 稳定运行,仍有余量 │
└─────────────┴────────┴──────────┴──────────────────────────────┘
十、综合评分
┌─────────────┬────────┬────────┬────────┬────────┬────────┬────────┐
│ 维度 │ 权重 │ WP │ Emlog │ Typecho│ winner│ │
├─────────────┼────────┼────────┼────────┼────────┼────────┼────────┤
│ 磁盘占用 │ 10% │ 6 │ 8 │ 10 │ Typecho│ │
│ 内存基线 │ 20% │ 6 │ 8 │ 10 │ Typecho│ │
│ 默认QPS │ 25% │ 5 │ 7 │ 10 │ Typecho│ │
│ 优化后QPS │ 20% │ 6 │ 8 │ 10 │ Typecho│ │
│ 后台性能 │ 10% │ 5 │ 8 │ 10 │ Typecho│ │
│ 生态/扩展 │ 15% │ 10 │ 6 │ 5 │ WP │ │
├─────────────┼────────┼────────┼────────┼────────┼────────┼────────┤
│ 综合得分 │ 100% │ 6.35 │ 7.55 │ 8.85 │ Typecho│ │
└─────────────┴────────┴────────┴────────┴────────┴────────┴────────┘
评分说明:
- 生态/扩展:WordPress 插件数量碾压,得10分
- 其余维度:Typecho 和 Emlog 凭借精简架构领先
- 1核1G场景下,"轻"就是硬道理
十一、结论与选购建议
┌─────────────────────────────────────────────────────────────────────┐
│ 如果你用 1核1G VPS: │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ 选 Typecho 如果: │
│ - 你会写一点 PHP / 前端代码 │
│ - 追求极致性能和低资源占用 │
│ - 不需要复杂功能,文章+评论足够 │
│ │
│ 选 Emlog 如果: │
│ - 想要中文原生体验,后台简单直观 │
│ - 不折腾插件,开箱即用 │
│ - 资源占用可接受,比 WP 轻快很多 │
│ │
│ 选 WordPress 如果: │
│ - 你需要电商、会员、多语言等复杂功能 │
│ - 你愿意为性能付出更多服务器成本(至少2核2G) │
│ - 你依赖插件生态,不想自己写代码 │
│ │
└─────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────┐
│ 实测数据总结: │
│ │
│ - 默认配置下,Typecho QPS 是 WordPress 的 2.1 倍 │
│ - 优化后,差距缩小到 2.2 倍(WordPress 优化空间更大) │
│ - WordPress 后台 CPU 占用是 Typecho 的 3-4 倍 │
│ - 同样10篇文章,WordPress 数据库查询数是 Typecho 的 3 倍 │
│ │
│ 一句话:1核1G 优先 Typecho 或 Emlog,WordPress 建议 2核2G 起步。 │
└─────────────────────────────────────────────────────────────────────┘
数据不会骗人。在资源受限的场景下,架构的精简程度直接决定你能撑多少流量。 WordPress 的强大生态是有代价的——每一行多余的查询、每一个自动加载的 option,都在 1核1G 的 VPS 上留下痕迹。



