首页 > 代码库 > Ehcache介绍
Ehcache介绍
1.相关背景
局部访问性原则:被访问的数据以及临近的数据很有可能被再次访问到。
Locality of Reference,Data that is near other data or has recently been used is more likely to be used again.
长尾原则:二八原则。
If 20% of objects are used 80% of the time and a way can befound to reduce the cost of obtaining that 20%, system performance will improve.
加速cpu瓶颈应用:提升算法性能;并行化计算,多个cpu(smp)或者多台主机(clusters,集群),升级cpu速度
加速i/o瓶颈应用:缓存。(网络io,磁盘io)
Applying Amdahl‘s Law :1 / ((1 - Proportion Sped Up) + Proportion Sped Up / Speed up) 计算加速效果
影响缓存性能因素:数据活跃度;缓存数据的比例(垃圾回收机制不利于太大堆内存);数据使用的分布(二八原则);读写频率
缓存类型:
Standalone 单机,
Distributed分散
The data is held in a remote server (or array of servers) with a subset of
recently used data held in each application node.
Replicated,复制试
The cached data set is held in each application node and data is copied or
invalidated across the nodes without locking.
存储层次
MemoryStore,堆内存储,OfferHeapStore 堆外直接内存分配,DiskStore 磁盘存储
推荐阅读
http://raychase.iteye.com/blog/1545906
Ehcache介绍