18.2.3. Unscheduled Write-Behind Strategy Configuration (Library Mode)


To enable the write-behind strategy of the cache entries to a store, add the async element to the store configuration as follows:

Procedure 18.3. The async Element

The async element uses the following configuration parameters:
  1. The modificationQueueSize parameter sets the modification queue size for the asynchronous store. If updates occur faster than the cache store can process the queue, the asynchronous store behaves like a synchronous store. The store behavior remains synchronous and blocks elements until the queue is able to accept them, after which the store behavior becomes asynchronous again.
    <persistence>
        <fileStore location="${LOCATION}">
            <async enabled="true" 
                        modificationQueueSize="1024" />
    
  2. The shutdownTimeout parameter specifies the time in milliseconds after which the cache store is shut down. This provides time for the asynchronous writer to flush data to the store when a cache is shut down. The default value for this parameter is 25000.
    <persistence>
        <fileStore location="${LOCATION}">
            <async enabled="true" 
                        modificationQueueSize="1024" 
                        shutdownTimeout="25000" />
    
  3. The flushLockTimeout parameter specifies the time (in milliseconds) to acquire the lock that guards the state to be periodically flushed. The default value for this parameter is 15000.
    <persistence>
        <fileStore location="${LOCATION}">
            <async enabled="true" 
                        modificationQueueSize="1024" 
                        shutdownTimeout="25000" 
                        flushLockTimeout="15000" />
    
  4. The threadPoolSize parameter specifies the number of threads that concurrently apply modifications to the store. The default value for this parameter is 5.
    <persistence>
        <fileStore location="${LOCATION}">
            <async enabled="true" 
                        modificationQueueSize="1024" 
                        shutdownTimeout="25000" 
                        flushLockTimeout="15000" 
                        threadPoolSize="5"/>
        </fileStore>
    </persistence>
    
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.