[ 
https://issues.apache.org/jira/browse/DERBY-2911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2911:
--------------------------------------

    Attachment: d2911-1.stat
                d2911-1.diff

Attached is a partial implementation of a new buffer manager. It adds a class 
called ConcurrentCache, which implements the CacheManager interface and keeps 
the cached objects in a ConcurrentHashMap. It also adds ConcurrentCacheFactory, 
which creates instances of the new cache, and CacheEntry, which represents an 
entry in the cache and uses a ReentrantLock to protect its internal state from 
concurrent accesses.

Currently, only basic operations like find, release, release, remove and clean 
have been implemented. There is no replacement algorithm, which basically means 
that the cache doesn't have a defined maximum size. I managed to run the 
attached performance test with the patch (manually edited modules.properties to 
load the new buffer manager). It showed promising results. With 100 threads on 
a machine with eight CPUs, the throughput was almost doubled. With fewer 
threads (or fewer CPUs) there was of course less improvement. I didn't notice 
any performance loss for the single-threaded case, though.

> Implement a buffer manager using java.util.concurrent classes
> -------------------------------------------------------------
>
>                 Key: DERBY-2911
>                 URL: https://issues.apache.org/jira/browse/DERBY-2911
>             Project: Derby
>          Issue Type: Improvement
>          Components: Performance, Services
>    Affects Versions: 10.4.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d2911-1.diff, d2911-1.stat, d2911-unused.diff, 
> d2911-unused.stat, d2911perf.java
>
>
> There are indications that the buffer manager is a bottleneck for some types 
> of multi-user load. For instance, Anders Morken wrote this in a comment on 
> DERBY-1704: "With a separate table and index for each thread (to remove latch 
> contention and lock waits from the equation) we (...) found that 
> org.apache.derby.impl.services.cache.Clock.find()/release() caused about 5 
> times more contention than the synchronization in LockSet.lockObject() and 
> LockSet.unlock(). That might be an indicator of where to apply the next push".
> It would be interesting to see the scalability and performance of a buffer 
> manager which exploits the concurrency utilities added in Java SE 5.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to