欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

小弟我测出的单并发情况下memcache插入速度好慢啊200/s,小弟我向一个innodb表中插入速度,都比这快啊为什么

更新时间: 2014-01-05 01:59:12 责任编辑: Author_N1

 

我测出的单并发情况下memcache插入速度好慢啊,200/S,我向一个innodb表中插入速度,都比这快啊,为什么
我测出的单并发情况下memcache插入速度好慢啊,200/S,我向一个innodb表中插入速度,都比这快啊,为什么

我向一个innodb表中插入速度,都比这快啊,为什么

jfy_test2.php
<?php
$memcache = memcache_pconnect('localhost', 11212);

if ($memcache) {
  $memcache->set(uniqid(), "String to store in memcached,String to store in memcached");
  echo "OK,Apache进程号". getmypid();
}
else {
  echo "Connection to memcached failed";
}
?>

ab -n 1000 -c 1 http://192.168.2.56:8084/phptest/jfy_test2.php

Server Software: Apache/2.2.19
Server Hostname: 192.168.2.56
Server Port: 8084

Document Path: /phptest/jfy_test2.php
Document Length: 20 bytes

Concurrency Level: 1
Time taken for tests: 3.998 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 193000 bytes
HTML transferred: 20000 bytes
Requests per second: 250.14 [#/sec] (mean)


jfy_test.php
<?php
  $dblnk = mysql_pconnect('localhost:3308', 'root', 'cpyf');
  mysql_select_db('test', $dblnk);
  uniqid();
  mysql_query("insert into test7 values ('1111111111','1111111111','1111111111','1111111111','1111111111')", $dblnk);
  echo "OK,Apache进程号". getmypid();
?>

ab -n 1000 -c 1 http://192.168.2.56:8084/phptest/jfy_test.php

Server Software: Apache/2.2.19
Server Hostname: 192.168.2.56
Server Port: 8084

Document Path: /phptest/jfy_test.php
Document Length: 20 bytes

Concurrency Level: 1
Time taken for tests: 4.132 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 193000 bytes
HTML transferred: 20000 bytes
Requests per second: 242.03 [#/sec] (mean)



--参考方法--
都是本地吗?
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 01:59:12
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/4124/
本文WWW.DOC100.NET DOC100.NET版权所有。