redis memcache 性能测试
来源:互联网 发布:异或 c语言 编辑:程序博客网 时间:2024/05/27 14:11
$m = new Memcached();
$m->addServer('127.0.0.1',11211);
for($i=0;$i<1000;$i++){
//$m->set($i,microtime());
$m->get($i);
}
$r = new Redis;
$r->connect('127.0.0.1',6379);
for($i=0;$i<1000;$i++){
//$r->set($i,microtime());
$r->get($i);
}
//redis get
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: nginx/1.9.4
Server Hostname: localhost
Server Port: 80
Document Path: /test/test.php
Document Length: 0 bytes
Concurrency Level: 100
Time taken for tests: 47.997 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 147000 bytes
HTML transferred: 0 bytes
Requests per second: 20.83 [#/sec] (mean)
Time per request: 4799.664 [ms] (mean)
Time per request: 47.997 [ms] (mean, across all concurrent requests)
Transfer rate: 2.99 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.6 0 6
Processing: 103 4646 737.0 4787 6722
Waiting: 97 4646 737.0 4787 6722
Total: 103 4646 736.0 4787 6722
Percentage of the requests served within a certain time (ms)
50% 4787
66% 4814
75% 4822
80% 4849
90% 4925
95% 5343
98% 6071
99% 6128
100% 6722 (longest request)
//redis set
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: nginx/1.9.4
Server Hostname: localhost
Server Port: 80
Document Path: /test/test.php
Document Length: 0 bytes
Concurrency Level: 100
Time taken for tests: 51.391 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 147000 bytes
HTML transferred: 0 bytes
Requests per second: 19.46 [#/sec] (mean)
Time per request: 5139.068 [ms] (mean)
Time per request: 51.391 [ms] (mean, across all concurrent requests)
Transfer rate: 2.79 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.3 0 6
Processing: 92 4975 728.6 5115 7040
Waiting: 86 4975 728.6 5115 7040
Total: 92 4975 727.6 5115 7040
Percentage of the requests served within a certain time (ms)
50% 5115
66% 5163
75% 5207
80% 5213
90% 5231
95% 5253
98% 6202
99% 6579
100% 7040 (longest request)
//memcache get
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: nginx/1.9.4
Server Hostname: localhost
Server Port: 80
Document Path: /test/test.php
Document Length: 0 bytes
Concurrency Level: 100
Time taken for tests: 23.268 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 147000 bytes
HTML transferred: 0 bytes
Requests per second: 42.98 [#/sec] (mean)
Time per request: 2326.798 [ms] (mean)
Time per request: 23.268 [ms] (mean, across all concurrent requests)
Transfer rate: 6.17 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.1 0 6
Processing: 68 2246 802.2 2073 3578
Waiting: 63 2246 802.2 2073 3578
Total: 68 2247 801.8 2073 3578
Percentage of the requests served within a certain time (ms)
50% 2073
66% 2900
75% 3030
80% 3111
90% 3265
95% 3352
98% 3430
99% 3456
100% 3578 (longest request)
//memcache set
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: nginx/1.9.4
Server Hostname: localhost
Server Port: 80
Document Path: /test/test.php
Document Length: 0 bytes
Concurrency Level: 100
Time taken for tests: 30.619 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 147000 bytes
HTML transferred: 0 bytes
Requests per second: 32.66 [#/sec] (mean)
Time per request: 3061.896 [ms] (mean)
Time per request: 30.619 [ms] (mean, across all concurrent requests)
Transfer rate: 4.69 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.9 0 8
Processing: 58 2966 653.7 2989 4569
Waiting: 44 2966 653.7 2989 4569
Total: 59 2967 652.7 2989 4569
Percentage of the requests served within a certain time (ms)
50% 2989
66% 3128
75% 3288
80% 3368
90% 3814
95% 4125
98% 4336
99% 4432
100% 4569 (longest request)
+session stored
ini_set('session.gc_maxlifetime', 3600);
ini_set("session.save_handler","redis");
ini_set("session.save_path","tcp://127.0.0.1:6379");
session_start();
$_SESSION['session'] = 'this is session content!';
//echo $_SESSION['session'];
//echo session_id().'<br/>';
//
//$redis = new redis();
//$redis->connect('127.0.0.1', 6379);
////redis用session_id作为key并且是以string的形式存储
//echo $redis->get('PHPREDIS_SESSION:' . session_id());
/*PHPREDIS_SESSION+session_id()*/
/*
* This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: nginx/1.9.4
Server Hostname: localhost
Server Port: 80
Document Path: /test/test.php
Document Length: 2 bytes
Concurrency Level: 50
Time taken for tests: 0.880 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 344000 bytes
HTML transferred: 2000 bytes
Requests per second: 1136.97 [#/sec] (mean)
Time per request: 43.977 [ms] (mean)
Time per request: 0.880 [ms] (mean, across all concurrent requests)
Transfer rate: 381.95 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 4.2 0 23
Processing: 2 42 10.4 44 60
Waiting: 0 42 10.5 44 60
Total: 5 43 8.4 44 60
Percentage of the requests served within a certain time (ms)
50% 44
66% 47
75% 49
80% 49
90% 52
95% 59
98% 59
99% 59
100% 60 (longest request)
*/
ini_set("session.save_handler", "memcache");
ini_set("session.save_path", "tcp://127.0.0.1:11211");
session_start();
$_SESSION[$i] = time();
/*
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: nginx/1.9.4
Server Hostname: localhost
Server Port: 80
Document Path: /test/test.php
Document Length: 2 bytes
Concurrency Level: 50
Time taken for tests: 11.352 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 344000 bytes
HTML transferred: 2000 bytes
Requests per second: 88.09 [#/sec] (mean)
Time per request: 567.596 [ms] (mean)
Time per request: 11.352 [ms] (mean, across all concurrent requests)
Transfer rate: 29.59 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 5
Processing: 19 559 104.2 559 991
Waiting: 15 559 104.2 559 991
Total: 19 559 103.9 559 991
Percentage of the requests served within a certain time (ms)
50% 559
66% 593
75% 616
80% 629
90% 672
95% 713
98% 776
99% 798
100% 991 (longest request)
*
*/
- redis memcache 性能测试
- Redis和Memcache性能测试对比
- redis memcache 性能比较
- memcache原生性能测试
- Redis与Memcache性能对比
- 来一次 memcache,redis 性能测试大对比,分别测试大字节数和小字节数
- redis-benchmark 测试redis性能
- redis性能测试(redis-benchmark)
- Redis-benchmark测试Redis性能
- Redis插入性能测试
- redis性能测试
- redis读写性能测试
- redis读写性能测试
- redis 性能测试方法
- redis性能测试
- redis性能测试
- redis性能测试工具
- Redis性能测试
- js 实现判断表单中必填项并进行提示
- 如何解决Mac中OS X Mavericks 虚拟机启动出现黑屏
- MongoDB Sharding 分片技术
- Android中的常用单位转换
- Jetty和Tomcat的选择:按场景而定
- redis memcache 性能测试
- gcc 4.8.1 安装
- 1Activity+多Fragment遇到的问题及解决方案。
- maven
- 跨域传值精髓
- 一些常用的医学术语
- qsort和sort的区别
- C++学习之分解质因数
- 静态代码块(二)