2009/02
26
今天
沪杭高铁已经开始建设, 并争取在上海世博会之前完工。
看了一下沪杭的站点设置情况, 很乐观。 仅仅在短短的159公里中,设置了9个车站。其中包括松江、枫泾、嘉善等一些小的县级市。
这样看来, 沪昆铁路是可以在县级市设定站点的。
在沪昆高铁湖南段,冷水江, 新化, 都有设站的可能。冷新和邵阳之争,祝愿冷新一定要胜利!
支持冷新人民对沪昆铁路的争夺!
Defined tags for this entry:
沪昆高铁
Posted by rollenc
Last modified on 2009-03-03 15:14
2009/02
10
今天对几种缓存存储器进行了对比。发现最快的存储还是硬盘。当然,硬盘是很强悍的硬盘: SAS 15K。
对比数据:
Mysql:5.8483519554138
Memcached: 2.5365290641785
File: 0.48778581619263
测试环境:
Mysql5 局域网
Memcached 局域网
File 本机器
PHP5.1.6 测试代码使用PHP运行。均为原生函数 mysql_query, memcache_get, file_get_contents
测试循环次数:
10K
机器配置:
CPU 2.8x4
内存 8G
硬盘 SAS 15K
如果不需要考虑多服务器共享, 还是file cache来得方便来得快。
补上测试代码
测试代码如下,头部有mysql和memcache的连接工作,略去。
echo "Mysql Primary:";
$startTime = microtime(1);
for($i=0; $i<10000; $i++) {
$result = mysql_query("select * from Cache Where ID = ".$i);
$thread = mysql_fetch_row($result);
}
echo microtime(true) - $startTime;
echo "\n";
echo "Memcached: ";
$startTime = microtime(1);
for($i=0;$i<10000;$i++) {
if(! $thread = memcache_get($memcache_obj, 'sdfsdafsdaf'.$i)) {
//echo 'Nerver got here';
$result = mysql_query("select * from Cache Where ID = ".$i);
$thread = mysql_fetch_row($result);
if($thread == null) {
$thread = 'Missing';
}
memcache_set($memcache_obj, 'sdfsdafsdaf'.$i, $thread, null, 30);
}
}
echo microtime(true) - $startTime;
echo "\n";
echo "File: ";
$startTime = microtime(1);
for($i=0;$i<10000;$i++) {
if(! $thread = unserialize(file_get_contents('cache/'.'sdfsdafsdaf'.$i . '.cache'))) {
//echo 'Nerver got here';
$result = mysql_query("select * from Cache Where ID = ".$i);
$thread = mysql_fetch_row($result);
if($thread == null) {
$thread = 'Missing';
}
file_put_contents('cache/'.'sdfsdafsdaf'.$i . '.cache', serialize($thread));
}
}
echo microtime(true) - $startTime;
echo "\n";
Posted by rollenc
Last modified on 2009-12-04 23:36
2009/02
9
贴图不说话
Posted by rollenc
Last modified on 2009-02-10 08:10
2009/02
9
很抱歉, 上个月的事情Write Summary没有完成, 甚至可以说,没有做。
仔细的看了一本书,《思考的技术》,动笔写summary的时候, 不知道如何写起,也就很快放弃了自己的这一个计划。
很不好,很失败。 这是第一个未完成任务, 也希望是最后一个。
本月的任务是早起床。目前的作息时间是晚11点或12点睡觉,早上8点10分起床。起床很晚,且睡眠时间超过8小时。
预备的时间调整:
1. 没有特别的事情11点半睡觉。 最迟不得超过12点。
2. 每天早起5分钟。 到本月底,早上7点必须起床。
本任务将阶段性实行,一直持续到睡眠时间减少至6个半小时为止。 半年内完成。
Posted by rollenc
Last modified on 2009-02-09 17:53