编译安装lamp-4(安装xcache,为php加速)
admin
2023-06-21 01:41:39
0

***********安装xcache,为php加速*******************


unzip -o PHPMyAdmin-4.0.5-all-languages.zip 

mv PHPMyAdmin-4.0.5-all-languages /usr/local/apache/htdocs/pma

1,压力测试:

ulimit -n 3000

ab -c 100 -n 2000 http://10.10.37.138/pma/index.php 十个并发,发两千个请求

[root@localhost local]# ulimit -n 3000

[root@localhost local]# ab -c 100 -n 2000 http://10.10.37.138/pma/index.php

This is ApacheBench, Version 2.3 <$Revision: 1554214 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking 10.10.37.138 (be patient)

Completed 200 requests

Completed 400 requests

Completed 600 requests

Completed 800 requests

Completed 1000 requests

Completed 1200 requests

Completed 1400 requests

Completed 1600 requests

Completed 1800 requests

Completed 2000 requests

Finished 2000 requests



Server Software:        Apache/2.4.9 服务器软件版本

Server Hostname:        10.10.37.138 请求的服务器地址

Server Port:            80 服务器端口


Document Path:          /pma/index.php

Document Length:        7794 bytes URL的大小


Concurrency Level:      100 并发请求

Time taken for tests:   103.874 seconds 整个测试经过的时长

Complete requests:      2000 一共2000的请求

Failed requests:        0

Total transferred:      17925162 bytes 包含首部和数据

HTML transferred:       15588000 bytes 总共传输的数据

Requests per second:    19.25 [#/sec] (mean) 每秒钟完成的请求数

Time per request:       5193.681 [ms] (mean) 每一批(100个)请求需要的时间

Time per request:       51.937 [ms] (mean, across all concurrent requests) 每一个请求消耗的时间

Transfer rate:          168.52 [Kbytes/sec] received 传输速率


Connection Times (ms) 连接时间

              min  mean[+/-sd] median   max

Connect:        0   11  58.9      0     497 连接建立

Processing:  2445 5139 1298.0   4850   17286 请求处理

Waiting:     2445 5111 1303.1   4820   17285 等待数据从磁盘加载完成并相应

Total:       2445 5150 1301.4   4858   17286


Percentage of the requests served within a certain time (ms)

  50%   4858

  66%   5165

  75%   5410

  80%   5590

  90%   6274

  95%   7209

  98%   9036

  99%  11075

 100%  17286 (longest request)

sync


2,下载xcache-3.1.2.tar.bz2 百度搜索即可

解压解包并编译安装

[root@localhost php]# man -M man/ phpize

/usr/local/php/bin/phpize 编译第三方扩展是都需要执行

./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config

make && make install

安装结束后会出现如下信息:

Installing shared extensions:    /usr/local/php/lib/php/extensions/no-debug-zts-20100525/

3,配置:

[root@localhost xcache-3.1.2]# mkdir /etc/php.d

[root@localhost xcache-3.1.2]# cp xcache.ini /etc/php.d/

[root@localhost xcache-3.1.2]# vi /etc/php.d/xcache.ini

extension = /usr/local/php/lib/php/extensions/no-debug-zts-20100525/

4,再做压力测试:

http://10.10.37.138/pma/index.php 刷新几次生成缓存

再执行测试

ab -c 100 -n 2000 http://10.10.37.138/pma/index.php

Requests per second:    80.13 [#/sec] (mean)

Time per request:       1248.033 [ms] (mean)

Time per request:       12.480 [ms] (mean, across all concurrent requests)

安装xcache之前的速度

Requests per second:    19.25 [#/sec] (mean)

Time per request:       5193.681 [ms] (mean)

Time per request:       51.937 [ms] (mean, across all concurrent requests)

速度上能×××倍多

Requests per second:    21.97 [#/sec] (mean)

Time per request:       4552.375 [ms] (mean)

Time per request:       45.524 [ms] (mean, across all concurrent requests)

适用于读的多,写的少的服务器类型


相关内容

热门资讯

致命管教:一桩熟人社会里的“生... 又是一起“管教“致死案。在甘肃嘉峪关,14岁男孩小超的生命终结在了一场以“心理疏导”为名的暴行中。与...
创维电视断电引起跳闸 电视机自动断电,表示电视机的电源部分电路进入了过载保护状态,是后级电路部分有元件击穿导致,在电视机使...
电饭锅短路引起跳闸怎么修 先去掉短路烧糊的痕迹,然后用胶布包裹重新固定线路然后再测试。然后再用万用表等查看是什么原因导致的跳闸...
冰箱漏电跳闸是什么原因引起的呢 比较常见的原因就是感应漏电,当冷藏柜启动之后,若柜内降温及控制部件均正常,外壳出现漏电现象,就说明冷...
“不舒服”的顶流男星,真的太敏... 你听过“不舒服文学”吗?想想上周日晚的自己,“当时以为是我敏感了,看了这几天大家的分析,我想说当时确...
马桶坐垫坏了怎么换盖怎么安装 马桶坐垫坏了怎么换盖怎么安装:一般马桶垫是与马桶盖连接在一起的,所以只需要找到固定马桶盖的螺丝,用螺...
空调怎么安装-中央空调规范安装... 空调远近驰名,许多人一说到空调第一反映就是空调,因其性能优良、品质优秀、性价比高,在空调界有着不可动...
谁的脸都可能被“偷”!AI短剧... 莫名成为反派角色,“被出演”AI短剧……近期,从知名演员到一般公众,多人发布维权声明,控诉肖像被AI...
加沙民众为遇袭身亡的哈马斯军事... 5月27日,民众在加沙城为遭以军空袭身亡的哈马斯军事领导人穆罕默德·奥达及其家人送葬。新华社发(里泽...
10名季节性零工,没有渡过那座... 露出水面的肯任屯漫水桥。除标注,本文图均为澎湃新闻记者葛明宁拍摄那两天,广西环江县洛阳镇永权村肯任屯...