xcache使用速度实践测试
总体环境都是在vw的虚拟机上。
在word上可以按表格来统计,一目了然。
1、单机安装:
单机环境:
os:centos 6.6 x64
php:php5.5.26
mysql: mysql-5.5.45
nginx:1.8.0
网站:wordpress
2、mysql分开了和存储nfs,总共三台服务器
环境:
os:centos 6.6 x64
php:5.3.27
mysql:5.5.32
网站:wordpress
3、在单机上测试用了xcache,
1)、xcache的配置文件php.ini用在xcache.mmap_path = /tmp/xcache上,大小是64M
测试结果如下:
50个连接:
[root@mysql_server ~]# webbench -c 50 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
50 clients, running 30 sec.
Speed=2264 pages/min, 1466030 bytes/sec.
Requests: 1132 susceed, 0 failed.
100个连接:
root@mysql_server webbench-1.5]# webbench -c 100 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
100 clients, running 30 sec.
Speed=2330 pages/min, 1507056 bytes/sec.
Requests: 1165 susceed, 0 failed.
300个连接:
[root@mysql_server ~]# webbench -c 300 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
300 clients, running 30 sec.
Speed=2360 pages/min, 1525897 bytes/sec.
Requests: 1180 susceed, 0 failed.
2)、把xcache缓存文件放在tmpfs文件系统中,tmpfs文件系统是在内存上。
php.ini配置文件改变为:
xcache.mmap_path = “/tmp/cache_php/xcache”
大小还是64M
挂载:
mount -t tmpfs -o size=64m tmpfs /tmp/cache_php
[root@clc-server lib]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 16G 3.6G 11G 25% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda4 13G 711M 12G 6% /application
/dev/sda1 190M 32M 149M 18% /boot
tmpfs 64M 14M 51M 21% /tmp/cache_php
测试结果:
并发100,时间30秒:
[root@mysql_server webbench-1.5]# webbench -c 100 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
100 clients, running 30 sec.
Speed=2408 pages/min, 1559937 bytes/sec.
Requests: 1204 susceed, 0 failed.
并发300,时间30秒
[root@mysql_server ~]# webbench -c 300 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
300 clients, running 30 sec.
Speed=2396 pages/min, 1546808 bytes/sec.
Requests: 1198 susceed, 0 failed.
并发50,时间30秒:
[root@mysql_server ~]# webbench -c 50 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
50 clients, running 30 sec.
Speed=2454 pages/min, 1585694 bytes/sec.
Requests: 1227 susceed, 0 failed.
比较:用在内存上速度要比用在磁盘上快。
4、在单机上测试没有用xcache
测试结果如下:
50个并发连接:
[root@mysql_server ~]# webbench -c 50 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
50 clients, running 30 sec.
Speed=1178 pages/min, 761794 bytes/sec.
Requests: 589 susceed, 0 failed.
100个并发连接:
[root@mysql_server ~]# webbench -c 100 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
100 clients, running 30 sec.
Speed=1132 pages/min, 732602 bytes/sec.
Requests: 566 susceed, 0 failed.
300个并发连接:
Requests: 497 susceed, 0 failed.
[root@mysql_server ~]# webbench -c 300 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
300 clients, running 30 sec.
Speed=794 pages/min, 513281 bytes/sec.
Requests: 397 susceed, 0 failed.
5 、在集群环境没有用xcache
测试结果如下:
300个并发连接:
[root@nfs_server webbench-1.5]# webbench -c 300 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
300 clients, running 30 sec.
Speed=770 pages/min, 484866 bytes/sec.
Requests: 385 susceed, 0 failed.
100个并发连接:
[root@nfs_server webbench-1.5]# webbench -c 100 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
100 clients, running 30 sec.
Speed=760 pages/min, 491226 bytes/sec.
Requests: 380 susceed, 0 failed.
50个并发连接:
[root@nfs_server webbench-1.5]# webbench -c 50 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
50 clients, running 30 sec.
Speed=764 pages/min, 495454 bytes/sec.
Requests: 382 susceed, 0 failed.
6、在集群环境中使用了xcache
1)、php.ini中缓存路径配置是:
xcache.mmap_path = “/dev/zero”
50个并发连接:
[root@nfs_server webbench-1.5]# webbench -c 50 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
50 clients, running 30 sec.
Speed=1288 pages/min, 832774 bytes/sec.
Requests: 644 susceed, 0 failed.
100个并发连接:
[root@nfs_server webbench-1.5]# webbench -c 100 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
100 clients, running 30 sec.
Speed=1274 pages/min, 825092 bytes/sec.
Requests: 637 susceed, 0 failed.
300个并发连接:
[oot@nfs_server webbench-1.5]# webbench -c 300 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
300 clients, running 30 sec.
Speed=1316 pages/min, 787616 bytes/sec.
Requests: 658 susceed, 0 failed.
2)、php.ini中缓存路径配置是:
xcache.mmap_path = “/tmp/xcache”
50个并发连接:
[root@nfs_server ~]# webbench -c 50 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
50 clients, running 30 sec.
Speed=1292 pages/min, 859576 bytes/sec.
Requests: 646 susceed, 0 failed.
100个并发连接:
[root@nfs_server ~]# webbench -c 100 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
100 clients, running 30 sec.
Speed=1302 pages/min, 862928 bytes/sec.
Requests: 651 susceed, 0 failed.
300个并发连接:
[root@nfs_server ~]# webbench -c 300 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
300 clients, running 30 sec.
Speed=1392 pages/min, 862727 bytes/sec.
Requests: 696 susceed, 0 failed.
3)、php.ini中缓存路径配置是:
xcache.mmap_path = “/tmp/cache_php/xcache”
使用内存文件系统:tmpfs
mount -t tmpfs -o size=64m tmpfs /tmp/cache_php/
50个并发连接:
[root@nfs_server ~]# webbench -c 50 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
50 clients, running 30 sec.
Speed=1304 pages/min, 864897 bytes/sec.
Requests: 652 susceed, 0 failed.
100个并发连接:
[root@nfs_server ~]# webbench -c 100 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
100 clients, running 30 sec.
Speed=1294 pages/min, 859623 bytes/sec.
Requests: 647 susceed, 0 failed.
300个并发连接:
[root@nfs_server ~]# webbench -c 300 -t 30 http://192.168.8.5/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.8.5/
300 clients, running 30 sec.
Speed=1324 pages/min, 878177 bytes/sec.
Requests: 662 susceed, 0 failed.
7、静态页面,页面只显示几个字测试如下:
[root@mysql_server ~]# webbench -c 100 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
100 clients, running 30 sec.
Speed=178560 pages/min, 794598 bytes/sec.
Requests: 89280 susceed, 0 failed.
[root@mysql_server ~]# webbench -c 1000 -t 30 http://192.168.168.238/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.168.238/
1000 clients, running 30 sec.
Speed=249252 pages/min, 1107976 bytes/sec.
Requests: 124493 susceed, 133 failed.
原文链接:xcache使用速度实践测试,转载请注明来源!