db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2911) Implement a buffer manager using java.util.concurrent classes
Date Mon, 12 Nov 2007 10:22:50 GMT

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

Knut Anders Hatlen commented on DERBY-2911:
-------------------------------------------

> One question: what happens if the clock rotates too fast and reaches
> a synchronized (due to I/O) page? Will it have to wait for the
> synchronization to be lifted, or can the clock jump to the next page
> somehow? Since the background cleaner is used to write most of the
> pages, it (the background cleaner) could potentially be far behind
> the clock if I understand this correctly. If the clock is
> unnecessarily blocked by I/O it's game over ;)

I made a change so that instead of cleaning the page while holding the
synchronization on the cache entry, the keep count was incremented (to
ensure that the page wouldn't get evicted) and the synchronization was
dropped. This didn't change anything, though. And thinking more about
it, that makes sense, since if the clock rotates too fast, there won't
be evictable pages and it's game over anyway...

That said, I think it's a good idea to drop the synchronization while
cleaning since it will increase the concurrency (although not by much,
since the synchronization is much more fine-grained than in Clock). I
think I'll keep it as it is for now and do a cleanup of it later.

Another potential concurrency improvement for the replacement
algorithm is to protect the clock with a
java.util.concurrent.locks.ReadWriteLock instead of synchronization on
the clock. Then we don't have to lock the clock structure exclusively
unless the clock needs to grow or shrink.

> 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: cleaner.diff, cleaner.tar, d2911-1.diff, d2911-1.stat, d2911-2.diff,
d2911-3.diff, d2911-4.diff, d2911-5.diff, d2911-6.diff, d2911-6.stat, d2911-7.diff, d2911-7a.diff,
d2911-entry-javadoc.diff, d2911-unused.diff, d2911-unused.stat, d2911perf.java, perftest6.pdf
>
>
> 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.


Mime
View raw message