• Elements awaiting spooling are spooled to the data file
• The free list and element list are serialized to the index file
On startup the following steps take place:
• An attempt is made to read the index file. If it does not exist or cannot be read successfully, due to disk corruption, upgrade of ehcache, change in JDK version etc, then the data file is deleted and the DiskStore starts with no Elements in it.
• If the index file is read successfully, the free list and element list are loaded into memory. Once this is done, the index file contents are removed. This way, if there is a dirty shutdown, when restarted, Ehcache will delete the dirt index and data files.
• The DiskStore starts. All data is available.
• The expiry thread starts. It will delete Elements which have expired.
43.一个示范性地配置:
把一个拥有8G机器内存的存储分配成各种存储。设想有一个7G的数据集,共7M个元素,每个元素1k大小。
我们设置1G的堆存储和7G的非堆存储:
java -Xms1G -Xmx1G -XX:maxDirectMemorySize=7G
对应的配置文件为:
maxElementsInMemory=100
overflowToOffHeap="true"(企业)
maxMemoryOffHeap="7G"
... />
44.对于第二种集群方法,以下服务器被测试过:
• Glassfish V2/V3
• Tomcat 6
• Jetty 6
Tomcat 6通过了所有的继集成测试
支持Weblogic10.3.2,但是SOAP不兼容。
45.最大的Ehcache单实例在内存中可以缓存20GB,最大的磁盘可以缓存100GB
46.关于ehcache server的相关命令用法在user guide的178页
47.
缓存属性:
缓存配置。
以下属性是必须的:
name-cache的标识符,在一个CacheManager中必须唯一
maxElementsInMemory-在内存中缓存的element的最大数目
maxElementsOnDisk-在磁盘上缓存的element的最大数目
eternal-设定缓存的elements是否有有效期。如果为true,timeouts属性被忽略
overflowToDisk-设定当内存缓存溢出的时候是否将过期的element缓存到磁盘上
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-25689-6.html
让我们的存款一下子水5%怎么不算上