From: Wolfgang M. M. <wol...@us...> - 2005-08-29 19:31:02
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/index In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21823/src/org/exist/storage/index Modified Files: CollectionStore.java BFile.java Log Message: Improved cache resize policy: eXist uses dynamic caches to adopt to different loads. It is thus important to determine if a page should be grown or shrinked in order to increase cache efficiency. So far, a cache was resized based on the number of page replacements. However, this is a bad measure as replacements can be positive as well as negative. The new implementation bases the resize decision on the thrashing factor of a cache. Thrashing occurs if a page is replaced from the cache and has to be reloaded shortly after. For the B+-tree pages, we normally don't want any trashing. For the data pages, a certain amount of thrashing is ok. Additionally, a huge cache can now be shrinked dynamically if a smaller cache requests a resize. Some caches (words.dbx) tend to grow very fast and consume the whole cache space, so there will be no space left for the slower-growing caches. This may lead to a bottleneck if the amount of stored data increases. Index: BFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/index/BFile.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BFile.java 27 Aug 2005 07:14:34 -0000 1.12 --- BFile.java 29 Aug 2005 19:30:55 -0000 1.13 *************** *** 142,146 **** public BFile(BrokerPool pool, byte fileId, boolean transactional, File file, CacheManager cacheManager, ! double cacheGrowth, int thresholdBTree, int thresholdData) throws DBException { super(pool, fileId, transactional, cacheManager, file, thresholdBTree); fileHeader = (BFileHeader) getFileHeader(); --- 142,146 ---- public BFile(BrokerPool pool, byte fileId, boolean transactional, File file, CacheManager cacheManager, ! double cacheGrowth, double thresholdBTree, double thresholdData) throws DBException { super(pool, fileId, transactional, cacheManager, file, thresholdBTree); fileHeader = (BFileHeader) getFileHeader(); *************** *** 1715,1719 **** try { write(); ! if (isTransactional && syncJournal) logManager.flushToLog(true); return true; --- 1715,1719 ---- try { write(); ! if (isTransactional && syncJournal && logManager.lastWrittenLsn() < getPageHeader().getLsn()) logManager.flushToLog(true); return true; Index: CollectionStore.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/index/CollectionStore.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CollectionStore.java 27 Aug 2005 07:14:34 -0000 1.3 --- CollectionStore.java 29 Aug 2005 19:30:55 -0000 1.4 *************** *** 27,31 **** */ public CollectionStore(BrokerPool pool, File file, CacheManager cacheManager) throws DBException { ! super(pool, NativeBroker.COLLECTIONS_DBX_ID, true, file, cacheManager, 1.25, 100, 1000); } --- 27,31 ---- */ public CollectionStore(BrokerPool pool, File file, CacheManager cacheManager) throws DBException { ! super(pool, NativeBroker.COLLECTIONS_DBX_ID, true, file, cacheManager, 1.25, 0.01, 0.03); } |