文件名称:memcached全面剖析
文件大小:930KB
文件格式:PDF
更新时间:2017-09-11 08:41:15
memcached 全面剖析
目录 译者序..................................................................................................................................................4 第1 章 memcached的基础.................................................................................................................5 1.1 memcached是什么?...............................................................................................................5 1.2 memcached的特征...................................................................................................................6 协议简单.....................................................................................................................................6 基于libevent的事件处理..........................................................................................................6 内置内存存储方式.....................................................................................................................6 memcached不互相通信的分布式.............................................................................................6 1.3 安装memcached.......................................................................................................................7 memcached的安装.....................................................................................................................7 memcached的启动.....................................................................................................................8 1.4 用客户端连接...........................................................................................................................8 1.5 使用Cache::Memcached..........................................................................................................9 使用Cache::Memcached连接memcached................................................................................9 保存数据...................................................................................................................................10 获取数据...................................................................................................................................10 删除数据...................................................................................................................................10 增一和减一操作.......................................................................................................................10 1.6 总结.........................................................................................................................................11 第2章 理解memcached的内存存储..............................................................................................12 2.1 Slab Allocation机制:整理内存以便重复使用...................................................................12 Slab Allocation的主要术语.....................................................................................................13 2.2 在Slab中缓存记录的原理....................................................................................................13 2.3 Slab Allocator的缺点.............................................................................................................13 2.4 使用Growth Factor进行调优................................................................................................14 2.5 查看memcached的内部状态................................................................................................15 2.6 查看slabs的使用状况...........................................................................................................16 2.7 总结.........................................................................................................................................17 第3 章 memcached的删除机制和发展方向...................................................................................18 3.1 memcached在数据删除方面有效利用资源.........................................................................18 数据不会真正从memcached中消失......................................................................................18 Lazy Expiration.........................................................................................................................18 3.2 LRU:从缓存中有效删除数据的原理.................................................................................18 3.3 memcached的最新发展方向.................................................................................................18 关于二进制协议.......................................................................................................................19 二进制协议的格式...................................................................................................................19 HEADER中引人注目的地方..................................................................................................20 2 idv2.com 3.4 外部引擎支持........................................................................................................................20 外部引擎支持的必要性...........................................................................................................20 简单API设计的成功的关键...................................................................................................21 重新审视现在的体系...............................................................................................................21 3.5 总结........................................................................................................................................22 第4 章 memcached的分布式算法...................................................................................................23 4.1 memcached的分布式.............................................................................................................23 memcached的分布式是什么意思?.......................................................................................23 4.2 Cache::Memcached的分布式方法........................................................................................25 根据余数计算分散...................................................................................................................25 根据余数计算分散的缺点.......................................................................................................26 4.3 Consistent Hashing.................................................................................................................27 Consistent Hashing的简单说明...............................................................................................27 支持Consistent Hashing的函数库..........................................................................................29 4.4 总结........................................................................................................................................29 第5 章 memcached的应用和兼容程序...........................................................................................30 5.1 mixi案例研究.........................................................................................................................30 服务器配置和数量...................................................................................................................30 memcached进程.......................................................................................................................31 memcached使用方法和客户端...............................................................................................31 5.2 memcached应用经验.............................................................................................................32 通过daemontools启动.............................................................................................................33 监视...........................................................................................................................................33 memcached的性能...................................................................................................................33 5.3 兼容应用程序........................................................................................................................35 Tokyo Tyrant案例.....................................................................................................................35 5.4 总结........................................................................................................................................36