tracker issue : CF-3669336

select a category, or use search below
(searches all categories and all time range)
Title:

cachegetallids() is very slow when ehcache is configured to overflow to disk

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Mike Grove / Mike Grove (mgrove40)

Created: 11/15/2013

Components: Caching

Versions: 10.0

Failure Type: Performance Issue

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Platforms All

Vote Count: 1

Problem Description:

When configured to overflow to disk, calling cachegetallids() is very slow with only a few thousand items in cache.  Review the ehcache configuration in the "Test Configuration" section.

Steps to Reproduce:
<cfset start = getTickCount()>
<cfset cacheids = cachegetallids('mycache')>
<cfdump var="#ArrayLen(cacheids)#" />
<cfdump var="#getTickCount() - start#" />

Actual Result:
With 4000 items in the cache, I'm benchmarking 23583ms response times.

Expected Result:
Using the workaround below on the same dataset and calling the ehcache java object directly, it responds in only 5ms.  I would expect the ColdFusion method to be comparable.

Any Workarounds:
Yes, call the getKeys() method off of the core ehcache java object: 
<cfset cache = cacheGetSession('mycache', 'true')>
<cfdump var="#ArrayLen(cache.getKeys())#"/>

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3669336

External Customer Info:
External Company:  
External Customer Name: mgrove40
External Customer Email:  
External Test Config: My Hardware and Environment details:



ehcache.xml configuration:

    	name="mycache"

        maxElementsInMemory="1"

        eternal="false"

        timeToIdleSeconds="86400"

        timeToLiveSeconds="86400"

        overflowToDisk="true"

        diskSpoolBufferSizeMB="30"

        maxElementsOnDisk="100000"

        diskPersistent="true"

        diskExpiryThreadIntervalSeconds="3600"

        memoryStoreEvictionPolicy="LRU"

        />

Attachments:

Comments:

Definitely sounds like a bug. There shouldn't be that big of a gap between a direct API call in Java and the equivalent call from a CF function.
Vote by External U.
13974 | November 15, 2013 09:02:55 AM GMT
added boolean param accurate(default true) to cacheGetAllids API . When set to false, API will be fast but result may not be as accurate as the usual API call. (Comment added from ex-user id:sandeepp)
Comment by Adobe D.
13970 | February 22, 2014 05:27:00 AM GMT
It is still not working.
Comment by Nimit S.
13971 | February 24, 2014 07:03:50 AM GMT
Please verify, the updated page here: https://wikidocs.adobe.com/wiki/display/coldfusionen/CacheGetAllIds
Comment by Frank J.
13972 | May 19, 2014 02:58:39 AM GMT
Nimit, I have updated the document.
Comment by Frank J.
13973 | November 26, 2014 01:43:32 AM GMT