首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > 高性能WEB开发 >

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

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

我测出的单并发情况下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)



[解决办法]
都是本地吗?

热点排行