博客园 - blockcipheruuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=551642014-02-19T06:25:18Zblockcipherhttps://www.cnblogs.com/blockcipher/feed.cnblogs.comhttps://www.cnblogs.com/blockcipher/p/3555734.html软件工程 - blockcipher软件工程复杂性http://mperry.github.io/2012/07/26/software-engineering-is-hard.htmlAccidental complexity can be addressed and resolved, e.g. the details of progamming in a lanuage. However, essential complexity is caused by the specification, design and testing of the software abstraction. The construction 2014-02-19T05:29:00Z2014-02-19T05:29:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】软件工程复杂性http://mperry.github.io/2012/07/26/software-engineering-is-hard.htmlAccidental complexity can be addressed and resolved, e.g. the details of progamming in a lanuage. However, essential complexity is caused by the specification, design and testing of the software abstraction. The construction <a href="https://www.cnblogs.com/blockcipher/p/3555734.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3529350.html互联网应用的状态线程库 - blockcipherhttp://state-threads.sourceforge.net/docs/st.htmlState Threads for Internet ApplicationsIntroductionState Threads is an application library which provides a foundation for writing fast and highly scalable Internet Applications on UNIX-like platforms. It combines the simplicity of the multithreaded p2014-01-22T02:32:00Z2014-01-22T02:32:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://state-threads.sourceforge.net/docs/st.htmlState Threads for Internet ApplicationsIntroductionState Threads is an application library which provides a foundation for writing fast and highly scalable Internet Applications on UNIX-like platforms. It combines the simplicity of the multithreaded p <a href="https://www.cnblogs.com/blockcipher/p/3529350.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3507023.htmlRedis宣言 - blockcipherhttp://oldblog.antirez.com/post/redis-manifesto.htmlRedis ManifestoRedis宣言Many times I don't know what to exactly reply to feature requests, or questions about why things in Redis are done in a specific way. Most of the time the questions make a lot of sense, there is not just a way to make thin2014-01-06T05:21:00Z2014-01-06T05:21:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://oldblog.antirez.com/post/redis-manifesto.htmlRedis ManifestoRedis宣言Many times I don't know what to exactly reply to feature requests, or questions about why things in Redis are done in a specific way. Most of the time the questions make a lot of sense, there is not just a way to make thin <a href="https://www.cnblogs.com/blockcipher/p/3507023.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3503133.html软件工程 - blockcipherSoftware DevelopmentWhat are the high-level concepts that people think about when they are developing software?Software EngineeringSoftware Engineering is concerned with constructing software systems that are:Correct, meaning they do exactly what it should;Reliable, meaning the don't crash;Robus2014-01-03T01:59:00Z2014-01-03T01:59:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】Software DevelopmentWhat are the high-level concepts that people think about when they are developing software?Software EngineeringSoftware Engineering is concerned with constructing software systems that are:Correct, meaning they do exactly what it should;Reliable, meaning the don't crash;Robus <a href="https://www.cnblogs.com/blockcipher/p/3503133.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3503104.html分布式编程 - blockcipherhttp://cs.lmu.edu/~rayIntroduction to Distributed ProgrammingDefinitionsDistributed ComputingComputing on a distributed systemDistributed SystemA system of computers communicating via messages over a network so as to cooperate on a task or tasks. There's no physical shared memory in a distribute2014-01-03T01:49:00Z2014-01-03T01:49:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://cs.lmu.edu/~rayIntroduction to Distributed ProgrammingDefinitionsDistributed ComputingComputing on a distributed systemDistributed SystemA system of computers communicating via messages over a network so as to cooperate on a task or tasks. There's no physical shared memory in a distribute <a href="https://www.cnblogs.com/blockcipher/p/3503104.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3503100.html编程泛型 - blockcipherhttp://cs.lmu.edu/~ray/Programming ParadigmsThe word paradigm is used a great deal when talking about programming languages. What does it mean?DefinitionAprogramming paradigmis a style or "way" of programming. Some languages make it easy to write in some paradigms but not others.List of Co2014-01-03T01:48:00Z2014-01-03T01:48:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://cs.lmu.edu/~ray/Programming ParadigmsThe word paradigm is used a great deal when talking about programming languages. What does it mean?DefinitionAprogramming paradigmis a style or "way" of programming. Some languages make it easy to write in some paradigms but not others.List of Co <a href="https://www.cnblogs.com/blockcipher/p/3503100.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3474253.htmltcp/ip高效编程总结 - blockcipher1.客户端-服务器结构 客户端-服务器结构的物理部署分为三类: (1)在同一台机器上:理想环境,只要压力不大,分组不会丢失、延迟和乱序,是理想的测试环境,可以用作评估客户端和服务器端程序的原始性能; (2)在同一局域网内:接近理想环境,分组很少丢失、乱序,但是有延迟; (3)在广域网内:分组丢失、重传、重复、乱序比较常见。2.基本套接字API (1)sys/socket.h、winsock2.h:SOCKET socket(int domain, int type, int protocol) 成功时返回套接字,失败时返回-1(linux),INVALID_SOCKET(win...2013-12-14T05:08:00Z2013-12-14T05:08:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】1.客户端-服务器结构 客户端-服务器结构的物理部署分为三类: (1)在同一台机器上:理想环境,只要压力不大,分组不会丢失、延迟和乱序,是理想的测试环境,可以用作评估客户端和服务器端程序的原始性能; (2)在同一局域网内:接近理想环境,分组很少丢失、乱序,但是有延迟; (3)在广域网内:分组丢失、重传、重复、乱序比较常见。2.基本套接字API (1)sys/socket.h、winsock2.h:SOCKET socket(int domain, int type, int protocol) 成功时返回套接字,失败时返回-1(linux),INVALID_SOCKET(win... <a href="https://www.cnblogs.com/blockcipher/p/3474253.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3467265.htmlIP协议详解 - blockcipherhttp://www.cnblogs.com/vamei/archive/2012/12/02/2796988.htmlIPv4与IPv6头部的对比我们已经在IP接力中介绍过,一个IP包分为头部(header)和数据(payload/data)两部分。头部是为了实现IP通信必须的附加信息,数据是IP通信所要传送的信息。黄色区域 (同名区域)我们看到,三个黄色区域跨越了IPv4和IPv6。Version(4位)用来表明IP协议版本,是IPv4还是IPv6(IPv4, Version=0100; IPv6, Version=0110)。Source Adrresss和Destination Add2013-12-10T05:22:00Z2013-12-10T05:22:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://www.cnblogs.com/vamei/archive/2012/12/02/2796988.htmlIPv4与IPv6头部的对比我们已经在IP接力中介绍过,一个IP包分为头部(header)和数据(payload/data)两部分。头部是为了实现IP通信必须的附加信息,数据是IP通信所要传送的信息。黄色区域 (同名区域)我们看到,三个黄色区域跨越了IPv4和IPv6。Version(4位)用来表明IP协议版本,是IPv4还是IPv6(IPv4, Version=0100; IPv6, Version=0110)。Source Adrresss和Destination Add <a href="https://www.cnblogs.com/blockcipher/p/3467265.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3450351.htmlgevent程序员指南 - blockcipher转自http://xlambda.com/gevent-tutorial/gevent程序员指南由Gevent社区编写gevent是一个基于libev的并发库。它为各种并发和网络相关的任务提供了整洁的API。介绍贡献者核心部分Greenlets同步和异步执行确定性创建GreenletsGreenlet状态程序停止超时猴子补丁(Monkey patching)数据结构事件队列组和池锁和信号量线程局部变量子进程Actors真实世界的应用Gevent ZeroMQ简单serverWSGI Servers流式serverLong PollingWebsockets聊天server介绍本指南假定读者有中2013-11-29T13:47:00Z2013-11-29T13:47:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】转自http://xlambda.com/gevent-tutorial/gevent程序员指南由Gevent社区编写gevent是一个基于libev的并发库。它为各种并发和网络相关的任务提供了整洁的API。介绍贡献者核心部分Greenlets同步和异步执行确定性创建GreenletsGreenlet状态程序停止超时猴子补丁(Monkey patching)数据结构事件队列组和池锁和信号量线程局部变量子进程Actors真实世界的应用Gevent ZeroMQ简单serverWSGI Servers流式serverLong PollingWebsockets聊天server介绍本指南假定读者有中 <a href="https://www.cnblogs.com/blockcipher/p/3450351.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3436518.html网站架构 - blockcipher大型网站架构演变和知识体系之前也有一些介绍大型网站架构演变的文章,例如LiveJournal的、ebay的,都是非常值得参考的,不过感觉他们讲的更多的是每次演变的结果,而没有很详细的讲为什么需要做这样的演变,再加上近来感觉有不少同学都很难明白为什么一个网站需要那么复杂的技术,于是有了写这篇文章的想法,在这篇文章中将阐述一个普通的网站发展成大型网站过程中的一种较为典型的架构演变历程和所需掌握的知识体系,希望能给想从事互联网行业的同学一点初步的概念,:),文中的不对之处也请各位多给点建议,让本文真正起到抛砖引玉的效果。架构演变第一步:物理分离webserver和数据库最开始,由于某些想法,于是在互2013-11-21T14:30:00Z2013-11-21T14:30:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】大型网站架构演变和知识体系之前也有一些介绍大型网站架构演变的文章,例如LiveJournal的、ebay的,都是非常值得参考的,不过感觉他们讲的更多的是每次演变的结果,而没有很详细的讲为什么需要做这样的演变,再加上近来感觉有不少同学都很难明白为什么一个网站需要那么复杂的技术,于是有了写这篇文章的想法,在这篇文章中将阐述一个普通的网站发展成大型网站过程中的一种较为典型的架构演变历程和所需掌握的知识体系,希望能给想从事互联网行业的同学一点初步的概念,:),文中的不对之处也请各位多给点建议,让本文真正起到抛砖引玉的效果。架构演变第一步:物理分离webserver和数据库最开始,由于某些想法,于是在互 <a href="https://www.cnblogs.com/blockcipher/p/3436518.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3430499.htmlpython django入门 - blockcipher本文基于windows 7 64bit环境。一 下载如下工具1. python 2.6.6http://www.python.org/ftp/python/2.6.6/python-2.6.6.amd64.msi2.ez_setuphttp://peak.telecommunity.com/dist/ez_setup.py二 搭建环境1. 安装python2.6.6于D:\ProgramFiles\Python26\,并将D:\ProgramFiles\Python26\;D:\ProgramFiles\Python26\Scripts2. 安装ez_setup:ez_setup.py -U 2013-11-18T15:20:00Z2013-11-18T15:20:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】本文基于windows 7 64bit环境。一 下载如下工具1. python 2.6.6http://www.python.org/ftp/python/2.6.6/python-2.6.6.amd64.msi2.ez_setuphttp://peak.telecommunity.com/dist/ez_setup.py二 搭建环境1. 安装python2.6.6于D:\ProgramFiles\Python26\,并将D:\ProgramFiles\Python26\;D:\ProgramFiles\Python26\Scripts2. 安装ez_setup:ez_setup.py -U <a href="https://www.cnblogs.com/blockcipher/p/3430499.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3355571.html全局负载均衡GSLB - blockcipherhttp://www.zdnet.com.cn/wiki-GSLBGSLBGSLB 是英文Gobal Server Load Balance的缩写,意思是全局负载均衡。 作用:实现在广域网(包括互联网)上不同地域的服务器间的流量调配,保证使用最佳的服务器服务离自己最近的客户,从而确保访问质量。分类:基于DNS实现、基于重定向实现、基于路由协议实现。特点:能通过判断服务器的负载,包括CPU占用、带宽占用等数据,决定服务器的可用性,同时能判断用户(访问者)与服务器间的链路状况,选择链路状况最好的服务器。因此GSLB是对服务器和链路进行综合判断来决定由哪个地点的服务器来提供服务,实现异地服务器群服务2013-10-07T07:43:00Z2013-10-07T07:43:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://www.zdnet.com.cn/wiki-GSLBGSLBGSLB 是英文Gobal Server Load Balance的缩写,意思是全局负载均衡。 作用:实现在广域网(包括互联网)上不同地域的服务器间的流量调配,保证使用最佳的服务器服务离自己最近的客户,从而确保访问质量。分类:基于DNS实现、基于重定向实现、基于路由协议实现。特点:能通过判断服务器的负载,包括CPU占用、带宽占用等数据,决定服务器的可用性,同时能判断用户(访问者)与服务器间的链路状况,选择链路状况最好的服务器。因此GSLB是对服务器和链路进行综合判断来决定由哪个地点的服务器来提供服务,实现异地服务器群服务 <a href="https://www.cnblogs.com/blockcipher/p/3355571.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3319274.htmlsysstat 工具简介 - blockcipher转载地址http://www.ctohome.com/FuWuQi/1b/688.htmlsysstat 是Linux 系统中的常用工具包。它的主要用途是观察服务负载,比如CPU和内存的占用率、网络的使用率以及磁盘写入和读取速度等。sysstat 工具包中包含两类工具:即时查看工具:iostat、mpstat、sar累计统计工具:sar也就是说,sar 具有这两种功能。因此,sar 是 sysstat 中的核心工具。为了实现 sar 的累计统计,系统必须周期地记录当时的信息,这是通过调用 /usr/lib/sa/ 中的三个工具实现的:sa1 :收集并存储每天系统动态信息到一个二进制的文件中,用2013-09-13T07:08:00Z2013-09-13T07:08:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】转载地址http://www.ctohome.com/FuWuQi/1b/688.htmlsysstat 是Linux 系统中的常用工具包。它的主要用途是观察服务负载,比如CPU和内存的占用率、网络的使用率以及磁盘写入和读取速度等。sysstat 工具包中包含两类工具:即时查看工具:iostat、mpstat、sar累计统计工具:sar也就是说,sar 具有这两种功能。因此,sar 是 sysstat 中的核心工具。为了实现 sar 的累计统计,系统必须周期地记录当时的信息,这是通过调用 /usr/lib/sa/ 中的三个工具实现的:sa1 :收集并存储每天系统动态信息到一个二进制的文件中,用 <a href="https://www.cnblogs.com/blockcipher/p/3319274.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3279388.htmlbeanstalk源码剖析——数据结构 - blockcipherbeanstalk中两种重要的数据结构就是集合和最小堆。 1. 集合 集合struct ms { size_t used, cap, last; void **items; ms_event_fn oninsert, onremove;};voidms_init(ms a, ms_event_fn oninsert, ms_event_fn onremove){ a->us...2013-08-24T07:55:00Z2013-08-24T07:55:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】beanstalk中两种重要的数据结构就是集合和最小堆。 1. 集合 集合struct ms { size_t used, cap, last; void **items; ms_event_fn oninsert, onremove;};voidms_init(ms a, ms_event_fn oninsert, ms_event_fn onremove){ a->us... <a href="https://www.cnblogs.com/blockcipher/p/3279388.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3279382.htmlbeanstalk源码剖析——tube和job的操作 - blockcipher1. tube定义 在beanstalk中,tube只是一个消息队列的名字,本身只是作为job的容器,因此不具有复杂的操作。 由于job具有优先级,这里采用最小堆保存job job具有ready和delay两种状态,因此每个tube采用两个最小堆对job进行管理。 tube结构struct tube { uint refs; char name[MAX_TUBE_NAME_LEN]; ...2013-08-24T07:49:00Z2013-08-24T07:49:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】1. tube定义 在beanstalk中,tube只是一个消息队列的名字,本身只是作为job的容器,因此不具有复杂的操作。 由于job具有优先级,这里采用最小堆保存job job具有ready和delay两种状态,因此每个tube采用两个最小堆对job进行管理。 tube结构struct tube { uint refs; char name[MAX_TUBE_NAME_LEN]; ... <a href="https://www.cnblogs.com/blockcipher/p/3279382.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3279331.htmlbeanstalk源码剖析——网络框架 - blockcipher在beanstalk中,网络处理模块没有使用第三方库,而是作者自己实现的一个模块,总计代码不到100行。是epoll的使用典范。1. epoll_eventstruct epoll_event结构如下:struct epoll_event { __uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */};typedef union epoll_data { void ptr; int fd; __uint32_t u32; __uint64_t u64; }...2013-08-24T07:07:00Z2013-08-24T07:07:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】在beanstalk中,网络处理模块没有使用第三方库,而是作者自己实现的一个模块,总计代码不到100行。是epoll的使用典范。1. epoll_eventstruct epoll_event结构如下:struct epoll_event { __uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */};typedef union epoll_data { void ptr; int fd; __uint32_t u32; __uint64_t u64; }... <a href="https://www.cnblogs.com/blockcipher/p/3279331.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3279182.htmlbeanstalk源码剖析——文件结构和启动程序 - blockcipher1. 文件结构组织beanstalk的源码文件物理组织如下:makefile文件:Makefile 数据结构定义: dat.h 主程序: main.c Server实例: serv.c 协议处理: prot.c 连接管理: conn.c tube管理: tube.c job管理: job.c 集合管理: ms.c daemon监听端口: net.c epoll抽象: linux.c 堆操作: heap.c daemon框架: sd-daemon.h sd-daemon.c binlog处理: file.c walg.c 系统时间: tim...2013-08-24T04:32:00Z2013-08-24T04:32:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】1. 文件结构组织beanstalk的源码文件物理组织如下:makefile文件:Makefile 数据结构定义: dat.h 主程序: main.c Server实例: serv.c 协议处理: prot.c 连接管理: conn.c tube管理: tube.c job管理: job.c 集合管理: ms.c daemon监听端口: net.c epoll抽象: linux.c 堆操作: heap.c daemon框架: sd-daemon.h sd-daemon.c binlog处理: file.c walg.c 系统时间: tim... <a href="https://www.cnblogs.com/blockcipher/p/3279182.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3266401.htmlAuto Complete with Redis - blockcipherhttp://oldblog.antirez.com/post/autocomplete-with-redis.htmlHello! This isn't just a blog post, it is actually the Redis weekly update number eight, but we can't tell this to Google: naming posts likeRedis Weekly update #...will not play well with Google indexing, so I'm starting to use 2013-08-18T12:41:00Z2013-08-18T12:41:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://oldblog.antirez.com/post/autocomplete-with-redis.htmlHello! This isn't just a blog post, it is actually the Redis weekly update number eight, but we can't tell this to Google: naming posts likeRedis Weekly update #...will not play well with Google indexing, so I'm starting to use <a href="https://www.cnblogs.com/blockcipher/p/3266401.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3266398.htmlThe Secret To 10 Million Concurrent Connections -The Kernel Is The Problem, Not The Solution - blockcipherhttp://highscalability.com/blog/2013/5/13/the-secret-to-10-million-concurrent-connections-the-kernel-i.htmlNow that we have theC10K concurrent connection problemlicked, how do we level up and support 10 million concurrent connections? Impossible you say. Nope, systems right now are delivering 10 mil2013-08-18T12:38:00Z2013-08-18T12:38:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】http://highscalability.com/blog/2013/5/13/the-secret-to-10-million-concurrent-connections-the-kernel-i.htmlNow that we have theC10K concurrent connection problemlicked, how do we level up and support 10 million concurrent connections? Impossible you say. Nope, systems right now are delivering 10 mil <a href="https://www.cnblogs.com/blockcipher/p/3266398.html" target="_blank">阅读全文</a>https://www.cnblogs.com/blockcipher/p/3266396.htmlIntroducing Resque - blockcipherhttps://github.com/blog/542-introducing-resqueResqueis our Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.Background jobs can be any Ruby class or module that responds toperform. Your existing classes can easily be converted to bac2013-08-18T12:36:00Z2013-08-18T12:36:00Zblockcipherhttps://www.cnblogs.com/blockcipher/【摘要】https://github.com/blog/542-introducing-resqueResqueis our Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.Background jobs can be any Ruby class or module that responds toperform. Your existing classes can easily be converted to bac <a href="https://www.cnblogs.com/blockcipher/p/3266396.html" target="_blank">阅读全文</a>