代码改变世界

一些工作小收藏

2012-03-18 20:24  轩脉刃  阅读(756)  评论(0编辑  收藏  举报

安装fastcgi:

http://www.cyberciti.biz/faq/rhel-fedora-install-configure-nginx-php5/

 

 

 

命令:php -r 'echo date("YmdHis", 1330936860);'

 

php获取本进程函数:getmypid()

 

打出当时的方法名:

fwrite(STDOUT, __METHOD__ . "\n");

 

ll -h 看每个文件大小

 

监护redis报错:

http://xingqiba.sinaapp.com/?p=240

redis需要将

修改redis.conf的daemonize为no

[program:redis]

command = redis-server

autostart=true

autorestart=true

startsecs=3

[program:webdis]

command = /usr/local/webdis/webdis

autostart=true

autorestart=true

startsecs=3

 

 

http://incubator.apache.org/kafka/index.html

看一下

http://www.zeromq.org/intro:get-the-software

看一下

 

 

Yum search zeromq

查找与zeromq匹配的程序

 

http://blog.csdn.net/heiyeshuwu/article/details/3453854

Cannot find autoconf. Please check your autoconf installation and the

$PHP_AUTOCONF environment variable. Then, rerun this script.

Yum install autoconf

 

如何编写安装简单的php扩展:

http://blog.csdn.net/heiyeshuwu/article/details/3453854

 

reactor:

http://www.wuzesheng.com/?p=1624

http://www.wuzesheng.com/?p=1607

http://code.google.com/p/xiao5geproject/source/checkout

http://hi.baidu.com/charles_zhang/blog/item/5383236dd3ad23f0431694ab.html

http://blog.csdn.net/hackyz/article/details/5027352

http://hi.baidu.com/zjm1126/blog/item/7a69876d2bf256ee431694c3.html

 

redis 2.2和2.4区别:

两版本区别

http://zhupan.iteye.com/blog/1310670

 

redis的数据库键值设计

http://www.mysqlops.com/2011/09/06/redis-kv-design.html

 

1 安装zeromq

Yum install zeromq

 

 

Apache Kafka是一个分布式的订阅消息系统

通过O(1)的磁盘数据结构提供消息的持久化,这种结构对于即使数以TB的消息存储也能够保持长时间的稳定性能。

高吞吐量:即使是非常普通的硬件kafka也可以支持每秒数十万的消息。

支持通过kafka服务器和消费机集群来分区消息。

支持Hadoop并行数据加载。

Kafka aims to unify offline and online processing by providing a mechanism for parallel load into Hadoop as well as the ability to partition real-time consumption over a cluster of machines

Kafka的目的在于提供一种让集群计算并行的机制来统一离线和在线的消息处理,并且能很好的处理集群计算的实时消耗问题

Kafka提供了一套非常完善的javaAPI

Kafka也可以从命令行运行

Server:

启动zookeeper server

bin/zookeeper-server-start.sh config/zookeeper.properties

启动Kafka server

bin/kafka-server-start.sh config/server.properties

客户端:

发送消息:

bin/kafka-console-producer.sh --zookeeper localhost:2181 --topic test

另一个客户端:

bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning

Kafka最开始是由linkin公司来使用并发展起来的

Kafka主要用户activity stream and operational data(变化性较大的数据)

比如:

1 Feed,内容订阅

2 一些变化较大的投票和排名等数据

3 网站需要为了安全性在下线的时候能够进行垃圾网络爬虫的搜索,垃圾邮件的分析等

4 许多网站需要当事情发送的时候有实时的监控并进行报警

5 经常需要集群系统在下线的时候进行处理,上线的时候进行处理的报告。比如统计等

Linkin的结构: