<?php /*** * redis.php is used to test redis's benchmark * 2014-02-25 */ require_once 'dbops.php'; require_once 'mysql2redis.php'; require_once 'looptest.php'; #$tbname="account"; #$tbname="temp"; #$tbname="bench_no_index"; #$tbname="bench"; $dbname = "test"; $loop_times = 20; $tab_redis = new mysql2redis(); $tab_redis->setTBname($tbname); $tab_redis->setDBname($dbname); # $tab_redis->bench($items_number, $tbname); ## 创建数据表格 $startI = 9000; ## 29000 $endI = 10000; ## 30000 $sql = sprintf("select * from %s where idx > %d and idx < %d", $tbname, $startI, $endI); $tab_redis->mysql2redis($tbname, $sql); ######### 下面为测试调用 echo "</br>"; echo $sql; echo "</br>"; $lptest = new looptest(); $lptest->configure($tbname, $dbname);
<?php require_once 'mysql2redis.php'; $items_number = 2000000; $tab_redis = new mysql2redis(); $tab_redis->setDBname('test'); $tab_redis->setTBname('bench'); $tab_redis->bench($items_number); $tab_redis->bench($items_number, 'bench_no_index');