I’ve been doing some logging of object creation times in our open account process in production. Periodically, initializing an object would take way longer than expected. By initializing I mean calling it’s init() and passing a couple of arguments that may be simple variables or objects. e.g.
<cfset validateObj = createObject("component", "compExample").init(
productionMode = VARIABLES.productionMode,
ipWhiteListed = isWhiteListed,
ipLocatorObj = VARIABLES.ipLocatorObj ) />
Thats all that happens in init() methods. Generally the execution time would be 0ms, but at random times I might get 3 or 3.5 seconds. This is not specific to one particular server or to our generally busy period. It appears to be quite random.
One thought was that these templates were being evicted from our template cache as they are not especially frequently used, although I checked cfstat on a number of servers and the max CP/Sec is -1.
Running CF 8,0,1
Has anybody else ever come across this?
Increased the max number of items in the template cache. As the cache uses LRU and these objects are specific to functionality that is not particularly frequently used they were getting evicted from the cache. Updated half the servers and kept half the same and compared after the weekend. There was a dramatic reduction in object instantiation times on the servers where the cache was increased.