[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Syncronisation contention in application startup connecting to huge numbers of derby databases Knut Anders Hatlen Mon Feb 20 01:01:04 2012

David Sitsky <[EMAIL PROTECTED]> writes:

> Hi,
> I have an application on very beefy hardware, which for better or
> worse, has a gigantic number of derby databases it has to open on
> startup.  I have some multi-threaded code which opens the databases in
> parallel, but I have found many of the threads are stuck in one or two
> states as seen below:
> Is there any way this contention can be avoided? In this situation,
> it can take an hour to open all the databases due to the serialisation
> that is present.  Any advice would be highly appreciated.

Hi David,

One workaround might be to boot multiple Derby engines by using
different classloaders, and distribute the databases across the engines.
Since there is one FileMonitor per engine, having multiple engines
should reduce the contention.

The synchronization in FileMonitor's methods (the second stack you
posted) looks unnecessary to me, so I've filed
https://issues.apache.org/jira/browse/DERBY-5623 to reduce the use of
synchronization in that class.

Knut Anders