By default, a search cache is invalidated each time the index is deployed. This ensures that out-of-date queries are removed from the cache.

Unfortunately, this results in valid queries being flushed as well. As a result, load on the search engines tends to spike after a deployment, then decrease over time as more and more queries are cached. This pattern is repeated after each deployment, resulting in large fluctuations in the load.

To avoid these fluctuations, you can disable cache invalidation, and instead have individual queries evicted based on how long they have been in the cache. If you do this, it is a good idea to also disable storing any queries on disk, because looking for queries to evict on disk is very slow. You will also need to increase the maximum number of queries to keep in memory (since none will be stored on disk), and specify how long to keep a query before evicting it from the cache. So you might configure the CacheService component like this:

defaultDisableInvalidation=true
defaultTimeToLiveSeconds=3600
defaultMaxElementsInMemory=10000
defaultOverflowToDisk=false
defaultMemoryStoreEvictionPolicy=LRU
defaultMaxElementsOnDisk=0
defaultDiskPersistent=false

Note that if query invalidation is disabled, the setting for defaultTimeToLiveSeconds involves a tradeoff between keeping queries in the cache that are no longer valid (because the index has changed and has been redeployed) and evicting ones that still are (because they have been present longer than the configured value).