Archives: 6月 2012


判断Redis运行状况是否正常的Python监控脚本

import commands
 
'''
    execute system command
'''
def execSysCmd(cmd):
    (status,output) = commands.getstatusoutput(cmd)
    return (stat[......]<p class="read-more"><a href="http://neoremind.com/2012/06/%e5%88%a4%e6%96%adredis%e8%bf%90%e8%a1%8c%e7%8a%b6%e5%86%b5%e6%98%af%e5%90%a6%e6%ad%a3%e5%b8%b8%e7%9a%84python%e7%9b%91%e6%8e%a7%e8%84%9a%e6%9c%ac/">继续阅读</a></p>

memcache关于键值的一些限制

memcached的key最大长度

key的最大长度是250个字符。推荐使用使用较短的key,因为可以节省内存和带宽。
 

memcached的最长过期时间

过期时间最大可以达到30天。memcached把传入的过期时间(时间段)解释成时间点后,一旦到了这个时间点,memcache[……]

继续阅读

统计全年的一个shell脚本

有时候需要做一些统计操作,例如统计今年以来分天的某个操作,可以写出一个伪调用

for everyday in this year

    process_program everyday

其中everyday为参数。

 

问题来了,假定现在有一个脚本proce[……]

继续阅读