redis通过zadd导入6天CTP数据,
欢迎加入QQ群:<a href="http://shang.qq.com/wpa/qunwpa?idkey=33dc3562400ea77e23c713caf37585852c617efe2e09a24e8bd364a5748bd677">CTP/易盛(行情交易)开发</a>
php使用phpredis访问redis数据:
<?php
$redis = new Redis();
$redis->connect('192.168.1.207', 6379);
$redis->select(0);
$ticks = $redis->zrange("/CTP/SHFE/rb1610", 0, -1);
$data = "";
$count = 0;
foreach($ticks as $i => $tick)
{
echo $tick;
}
?>
shell脚本:
while [ 1 ]; do
wget http://192.168.1.207:8080/getdata.php -O 1.bin;
done;
测试结果:
192.168.1.207本机开12个shell请求 100 - 300 Mbps/s
192.168.1.201(100Mbps网络)开1个shell请求 50Mbps/s
192.168.1.198(windows 100Mbps网络)开 2个shell请求 50Mbps/s
Apache统计access_log:
10:07:00 - 10:17:49 2629条请求记录
平均每秒请求数量5.6:
2629/(7*60+49) = 5.6