db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Syncronisation contention in application startup connecting to huge numbers of derby databases
Date Mon, 20 Feb 2012 09:03:21 GMT
David Sitsky <david.sitsky@gmail.com> 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

View raw message