1
qiuai 2013-11-01 22:50:09 +08:00
坐等结果.lnmp我跑过半个多小时...
|
2
coosir 2013-11-01 23:38:16 +08:00
等结果。。另外想问的是,如果生产环境用编译安装以后升级只要重新编译覆盖吗?
|
3
xLzgkddTywk9ALsX 2013-11-01 23:57:34 +08:00
等结果
|
4
jybox 2013-11-02 00:07:17 +08:00
应该不会有多大差距
|
6
xLzgkddTywk9ALsX 2013-11-02 00:21:01 +08:00
Ngx-pagespeed也测试一下吧
|
8
AstroProfundis 2013-11-02 09:32:12 +08:00
真有趣,我看看也去跑个模拟低配VPS的测试好了...
|
9
qiuai 2013-11-02 10:27:37 +08:00
centos这种没有源直接安装的系统咋办....nginx到现在都没被收到源里...
|
10
046569 2013-11-02 11:15:34 +08:00 1
FPM数量受Web程序影响,无法简单固化.
YMate在搞的时候测试了很多方案:针对不同程序(现阶段是不同版本的Discuz!)调整进程数量,更换缓存程序等等,工程量巨大.相对来说,采用的是稳定而较快速的方案. 但并不是最快速的方案.即使针对网站程序去做特定的优化,编译的MySQL与源中的相比,性能差距也不足5%,考虑到误差,基本可以忽略不计. 现在的软件架构,基本上靠调整配置文件就能发挥大部分性能了,编译源中的软件实在是得不偿失,尤其是低配VPS上,更没多大意义. |
11
xLzgkddTywk9ALsX 2013-11-02 11:19:27 +08:00
pm = dynamicy应该是pm = static 如果你不想切换子进程的话
|
12
likexian 2013-11-02 12:11:11 +08:00
自己编译更多的是为了定制,如果只是为了性能,浪费这时间干嘛,性能不够直接加机器就完事,而且php解析器本身就那个东西,你不改代码指望性能有多大的变化
|
13
AstroProfundis 2013-11-02 19:01:49 +08:00
我用楼主一样的方法试了一下真实VPS环境下的情况。
母机配置: Intel(R) Xeon(R) CPU L5520 @ 2.27GHz 24GB RAM w/ 26GB Swap 一共是16个逻辑核心,系统是 CentOS 6 64bit w/ SolusVM w/ OpenVZ 因为机器基本上是闲置状态所以还专门开了一个小鸡跑了十个线程的 cgminer 拉高整机负载,开始测试之前母机的负载是 Load Average: 10.51 10.82 10.72 小鸡配置: 256MB RAM w/ 256MB vSwap 4 CPU Cores, 用的 SolusVM 默认的资源分配 系统是 Debian 7 64bit minimal 基本上感觉这个配置是比较接近大多数人上VPS折腾个人博客的条件的。 源安装用的 dotdeb 的 wheezy 源,除了 nginx 把 php 支持打开以外全部用默认配置,装了这些包: apt-get install nginx php5-fpm php5-mysql php5-curl php5-mcrypt php5-gd mysql-server mysql-client 然后采用和楼主完全相同的方法在另一台干净的小鸡里面跑的 ab 测试: Server Software: nginx/1.4.3 Server Hostname: masked ip addr Server Port: 80 Document Path: /?paged=2 Document Length: 48670 bytes Concurrency Level: 50 Time taken for tests: 9312.364 seconds Complete requests: 25000 Failed requests: 0 Write errors: 0 Total transferred: 1222175000 bytes HTML transferred: 1216750000 bytes Requests per second: 2.68 [#/sec] (mean) Time per request: 18624.728 [ms] (mean) Time per request: 372.495 [ms] (mean, across all concurrent requests) Transfer rate: 128.17 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 4 Processing: 1489 18607 958.7 18512 22655 Waiting: 218 17024 760.1 17017 19704 Total: 1492 18607 958.7 18512 22655 Percentage of the requests served within a certain time (ms) 50% 18512 66% 18890 75% 19171 80% 19355 90% 19772 95% 20129 98% 20551 99% 20854 100% 22655 (longest request) ---------------------------------------------------------- 接下来是编译安装的,同样用的是主楼里面提到的那个脚本;脚本安装过程整体感觉不错,而且可选的功能很多,赞一发。 安装过程中没有选择 memcache 等等各种缓存/加速/优化组件,有一个没记清是啥的反正是必选所以就用默认值了。 因为楼主提到了脚本的默认 php-fpm 配置不科学,所以我安装好后就直接把参数改成了和源安装一样的值: pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 别的都保持不变,包括 nginx 配置都是默认添加了 php 支持的所以完全没动。 同样是部署好一个 WordPress 3.7.1 英文版过后导入主题测试用例然后 ab 第二页: Server Software: nginx Server Hostname: masked ip addr Server Port: 80 Document Path: /?paged=2 Document Length: 48688 bytes Concurrency Level: 50 Time taken for tests: 14751.522 seconds Complete requests: 25000 Failed requests: 0 Write errors: 0 Total transferred: 1222125000 bytes HTML transferred: 1217200000 bytes Requests per second: 1.69 [#/sec] (mean) Time per request: 29503.044 [ms] (mean) Time per request: 590.061 [ms] (mean, across all concurrent requests) Transfer rate: 80.91 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 5 Processing: 2311 29474 1752.4 29319 36814 Waiting: 2309 29473 1752.4 29318 36812 Total: 2315 29474 1752.3 29319 36814 Percentage of the requests served within a certain time (ms) 50% 29319 66% 30072 75% 30482 80% 30759 90% 31558 95% 32379 98% 33340 99% 33969 100% 36814 (longest request) 差距比预想的还要明显 0.0 从最后的时间统计来看源安装环境已经响应全部数据的时候编译安装的还有超过一半的请求没有处理,顺便一提跑前一个测试的时候后一个正在编译安装,所以整机的IO和CPU负担都比跑后一个的时候要高... 求解释这是为啥... |
14
iZr 2013-11-02 23:19:44 +08:00
表示关注
|
16
vibbow OP |
17
yesono 2013-11-20 09:30:17 +08:00
@vibbow 测试机器512M版,OS:Ubuntu 12.04.3 x64 wordpress-3.7.1 (英文版)+ Theme Unit Test文件
# ab -n 25000 -c 50 http://demo.linuxeye.com/?paged=2 Server Software: nginx Server Hostname: demo.linuxeye.com Server Port: 80 Document Path: /?paged=2 Document Length: 40304 bytes Concurrency Level: 100 Time taken for tests: 539.276 seconds Complete requests: 2500 Failed requests: 0 Write errors: 0 Total transferred: 101265000 bytes HTML transferred: 100760000 bytes Requests per second: 4.64 [#/sec] (mean) Time per request: 21571.031 [ms] (mean) Time per request: 215.710 [ms] (mean, across all concurrent requests) Transfer rate: 183.38 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 3.2 0 19 Processing: 2743 21201 2344.4 21583 23536 Waiting: 2743 21201 2344.4 21583 23536 Total: 2761 21202 2341.6 21583 23536 Percentage of the requests served within a certain time (ms) 50% 21583 66% 21876 75% 22072 80% 22154 90% 22410 95% 22633 98% 22860 99% 22974 100% 23536 (longest request) Server Software: nginx Server Hostname: demo.linuxeye.com Server Port: 80 Document Path: /?paged=2 Document Length: 40304 bytes Concurrency Level: 50 Time taken for tests: 5410.895 seconds Complete requests: 25000 Failed requests: 0 Write errors: 0 Total transferred: 1012650000 bytes HTML transferred: 1007600000 bytes Requests per second: 4.62 [#/sec] (mean) Time per request: 10821.789 [ms] (mean) Time per request: 216.436 [ms] (mean, across all concurrent requests) Transfer rate: 182.76 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.5 0 12 Processing: 2923 10813 573.1 10760 13455 Waiting: 2923 10813 573.1 10760 13455 Total: 2934 10814 573.0 10760 13465 Percentage of the requests served within a certain time (ms) 50% 10760 66% 10988 75% 11147 80% 11257 90% 11550 95% 11794 98% 12088 99% 12272 100% 13465 (longest request) |
20
wshcdr 2017-03-09 16:15:17 +08:00
好帖留名
|