You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Arnaud Masson <am...@gmail.com> on 2009/05/01 16:09:10 UTC
Many background threads (rawStoreDaemon)
I have an application that opens several small derby databases (using
EmbeddedDriver).
Most of of these instances don't handle many requests.
The problem is that each instance maintain its own thread
"derby.rawStoreDaemon".
Is there a way to use a thread pool shared between instances instead ?
(There is also a discussion about that here:
http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
Thanks in advance!
Re: Many background threads (rawStoreDaemon)
Posted by Geoff hendrey <ge...@yahoo.com>.
+1
I think that is an important issue to resolve; my application is also affected by this.
-geoff
“XML? Too much like HTML. It'll never work on the Web!”
-anonymous
________________________________
From: Arnaud Masson <am...@gmail.com>
To: Derby Discussion <de...@db.apache.org>
Sent: Monday, May 4, 2009 2:15:50 AM
Subject: Re: Many background threads (rawStoreDaemon)
Knut Anders Hatlen a écrit :
> Dag.Wanvik@Sun.COM (Dag H. Wanvik) writes:
>
>
>> Arnaud Masson <am...@gmail.com> writes:
>>
>>
>>> I have an application that opens several small derby databases (using
>>> EmbeddedDriver).
>>> Most of of these instances don't handle many requests.
>>> The problem is that each instance maintain its own thread
>>> "derby.rawStoreDaemon".
>>> Is there a way to use a thread pool shared between instances instead ?
>>> (There is also a discussion about that here:
>>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
>>>
>> I am not aware any progress has been made on this issue, unfortunately.
>>
>
> If you think it should be adressed, filing a JIRA issue is a good first
> step: https://issues.apache.org/jira/browse/DERBY
>
> (I don't think there is one filed yet, is it?)
>
>
No I didn't find a Jira entry for that.
I have entered https://issues.apache.org/jira/browse/DERBY-4210.
Thanks!
Re: Many background threads (rawStoreDaemon)
Posted by Arnaud Masson <am...@gmail.com>.
Knut Anders Hatlen a écrit :
> Dag.Wanvik@Sun.COM (Dag H. Wanvik) writes:
>
>
>> Arnaud Masson <am...@gmail.com> writes:
>>
>>
>>> I have an application that opens several small derby databases (using
>>> EmbeddedDriver).
>>> Most of of these instances don't handle many requests.
>>> The problem is that each instance maintain its own thread
>>> "derby.rawStoreDaemon".
>>> Is there a way to use a thread pool shared between instances instead ?
>>> (There is also a discussion about that here:
>>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
>>>
>> I am not aware any progress has been made on this issue, unfortunately.
>>
>
> If you think it should be adressed, filing a JIRA issue is a good first
> step: https://issues.apache.org/jira/browse/DERBY
>
> (I don't think there is one filed yet, is it?)
>
>
No I didn't find a Jira entry for that.
I have entered https://issues.apache.org/jira/browse/DERBY-4210.
Thanks!
Re: Many background threads (rawStoreDaemon)
Posted by Geoff hendrey <ge...@yahoo.com>.
Regarding the comment:
"Don't you think you'd want to revisit the design of a derby system opening
up 1000 databases at a time? With respect to a centralized mail archive
system, you do have other design choices, like a centralized server..."
One of the primary reasons for selecting derby for my application was that I could conceivably run hundreds, even thousands of independent databases. Derby is fantastic (and unique), in the ability that we have, from java, to create databases on the fly, open them, shut them down, etc. We can encrypt the physical files, and keep them isolated from each other. This has many advantages for an application service provider, who hosts many customers. And in fact, it's the primary reason we choose derby.
Last year at JavaOne I discussed this with Knut, and the only thing that seemed like a problem was an issue with the page cache, which I was able to address via a config property. Therefore, I'd say this request is quite in keeping with the nature of a smal flexible database; essential to keep all elements of its footprint tiny: memory, disk etc. You may have seen some posts from me in the past requesting minimization of the number of files created when derby starts, but that is less important than memory and threads.
-geoff
“XML? Too much like HTML. It'll never work on the Web!”
-anonymous
________________________________
From: Michael Segel <ms...@segel.com>
To: Derby Discussion <de...@db.apache.org>
Sent: Monday, May 4, 2009 6:50:49 AM
Subject: RE: Many background threads (rawStoreDaemon)
> -----Original Message-----
> From: Arnaud Masson [mailto:amasson@gmail.com]
> Sent: Monday, May 04, 2009 8:04 AM
> To: Derby Discussion
> Subject: Re: Many background threads (rawStoreDaemon)
>
> derby@segel.com a écrit :
> >
> >> -----Original Message-----
> >>
> >>>> I have an application that opens several small derby databases (using
> >>>> EmbeddedDriver).
> >>>> Most of of these instances don't handle many requests.
> >>>> The problem is that each instance maintain its own thread
> >>>> "derby.rawStoreDaemon".
> >>>> Is there a way to use a thread pool shared between instances instead
> ?
> >>>> (There is also a discussion about that here:
> >>>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
> >>>>
> >>> I am not aware any progress has been made on this issue,
> unfortunately.
> >>>
> >> If you think it should be adressed, filing a JIRA issue is a good first
> >> step: https://issues.apache.org/jira/browse/DERBY
> >>
> >> (I don't think there is one filed yet, is it?)
> >>
> >
> > Ok so if I understand this...
> >
> > A person wants to open multiple embedded copies of a database and then
> > thread pool the database server connections/controllers of the
> individual
> > database connections.
> >
> > Ok, yes there is some merit to this. Unfortunately, you're adding a lot
> of
> > weight to the code that means a larger footprint making it harder to
> embed.
> >
> >
> This is not about connection pool.
> This is about the fact that each derby instance maintain a thread that
> is sleeping most of the time (rawStoreDaemon).
> It would be better for the footprint to free daemon threads when they
> are not used or to recycle them in a pool (like JDK Executor).
>
I think you misunderstand.
The footprint isn't the code running but the jar file being downloaded.
Look, I think everyone agrees that on the micro level, there are always
fixes that should go in to the code.
My point is that on a macro level, a lot of small code enhancements add up.
You're increasing the footprint of the code base which makes it more
difficult to embed in to some applications. Derby was a lightweight
database. Things like raw partitions, fragmented tables, etc ... weren't an
issue.
Is anyone thinking of these things on a macro level? And what direction do
you want to take Derby? Do you want to compete against MySQL or Postgres for
mindshare?
Do you want to build in shared nothing features for distributed queries and
make derby a data warehouse engine?
My suggestion is to review derby and determine how you can satisfy both
needs.
Does that make sense?
-Mike
PS. The example: " The issue is that if a Derby system is
booted with 1,000 databases, then 1,000 backgound threads are created,
all just to handle background work. The to-list item was intended change
the DaemonFactory from being booted per-database to being booted
per-system. Thus a single backgound thread would handle the idle
requests. Then, I agree, the DaemonFactory could be enhanced to support
a handful of worker threads behind the interface, without the knowledge
of the caller."
Don't you think you'd want to revisit the design of a derby system opening
up 1000 databases at a time? With respect to a centralized mail archive
system, you do have other design choices, like a centralized server...
Re: Many background threads (rawStoreDaemon)
Posted by Arnaud Masson <am...@gmail.com>.
Michael Segel a écrit :
>
>> -----Original Message-----
>> From: Arnaud Masson [mailto:amasson@gmail.com]
>> Sent: Monday, May 04, 2009 8:04 AM
>> To: Derby Discussion
>> Subject: Re: Many background threads (rawStoreDaemon)
>>
>> derby@segel.com a écrit :
>>
>>>> -----Original Message-----
>>>>
>>>>
>>>>>> I have an application that opens several small derby databases (using
>>>>>> EmbeddedDriver).
>>>>>> Most of of these instances don't handle many requests.
>>>>>> The problem is that each instance maintain its own thread
>>>>>> "derby.rawStoreDaemon".
>>>>>> Is there a way to use a thread pool shared between instances instead
>>>>>>
>> ?
>>
>>>>>> (There is also a discussion about that here:
>>>>>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
>>>>>>
>>>>>>
>>>>> I am not aware any progress has been made on this issue,
>>>>>
>> unfortunately.
>>
>>>> If you think it should be adressed, filing a JIRA issue is a good first
>>>> step: https://issues.apache.org/jira/browse/DERBY
>>>>
>>>> (I don't think there is one filed yet, is it?)
>>>>
>>>>
>>> Ok so if I understand this...
>>>
>>> A person wants to open multiple embedded copies of a database and then
>>> thread pool the database server connections/controllers of the
>>>
>> individual
>>
>>> database connections.
>>>
>>> Ok, yes there is some merit to this. Unfortunately, you're adding a lot
>>>
>> of
>>
>>> weight to the code that means a larger footprint making it harder to
>>>
>> embed.
>>
>>>
>> This is not about connection pool.
>> This is about the fact that each derby instance maintain a thread that
>> is sleeping most of the time (rawStoreDaemon).
>> It would be better for the footprint to free daemon threads when they
>> are not used or to recycle them in a pool (like JDK Executor).
>>
>>
>
> I think you misunderstand.
>
> The footprint isn't the code running but the jar file being downloaded.
>
> Look, I think everyone agrees that on the micro level, there are always
> fixes that should go in to the code.
>
> My point is that on a macro level, a lot of small code enhancements add up.
> You're increasing the footprint of the code base which makes it more
> difficult to embed in to some applications. Derby was a lightweight
> database. Things like raw partitions, fragmented tables, etc ... weren't an
> issue.
>
> Is anyone thinking of these things on a macro level? And what direction do
> you want to take Derby? Do you want to compete against MySQL or Postgres for
> mindshare?
>
> Do you want to build in shared nothing features for distributed queries and
> make derby a data warehouse engine?
>
> My suggestion is to review derby and determine how you can satisfy both
> needs.
>
> Does that make sense?
>
> -Mike
>
> PS. The example: " The issue is that if a Derby system is
> booted with 1,000 databases, then 1,000 backgound threads are created,
> all just to handle background work. The to-list item was intended change
> the DaemonFactory from being booted per-database to being booted
> per-system. Thus a single backgound thread would handle the idle
> requests. Then, I agree, the DaemonFactory could be enhanced to support
> a handful of worker threads behind the interface, without the knowledge
> of the caller."
>
> Don't you think you'd want to revisit the design of a derby system opening
> up 1000 databases at a time? With respect to a centralized mail archive
> system, you do have other design choices, like a centralized server...
>
Yes, it makes sense, thanks.
I was just thinking that using a thread pool would not be too heavy
compared to existing (advanced) derby features.
RE: Many background threads (rawStoreDaemon)
Posted by Michael Segel <ms...@segel.com>.
> -----Original Message-----
> From: Arnaud Masson [mailto:amasson@gmail.com]
> Sent: Monday, May 04, 2009 8:04 AM
> To: Derby Discussion
> Subject: Re: Many background threads (rawStoreDaemon)
>
> derby@segel.com a écrit :
> >
> >> -----Original Message-----
> >>
> >>>> I have an application that opens several small derby databases (using
> >>>> EmbeddedDriver).
> >>>> Most of of these instances don't handle many requests.
> >>>> The problem is that each instance maintain its own thread
> >>>> "derby.rawStoreDaemon".
> >>>> Is there a way to use a thread pool shared between instances instead
> ?
> >>>> (There is also a discussion about that here:
> >>>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
> >>>>
> >>> I am not aware any progress has been made on this issue,
> unfortunately.
> >>>
> >> If you think it should be adressed, filing a JIRA issue is a good first
> >> step: https://issues.apache.org/jira/browse/DERBY
> >>
> >> (I don't think there is one filed yet, is it?)
> >>
> >
> > Ok so if I understand this...
> >
> > A person wants to open multiple embedded copies of a database and then
> > thread pool the database server connections/controllers of the
> individual
> > database connections.
> >
> > Ok, yes there is some merit to this. Unfortunately, you're adding a lot
> of
> > weight to the code that means a larger footprint making it harder to
> embed.
> >
> >
> This is not about connection pool.
> This is about the fact that each derby instance maintain a thread that
> is sleeping most of the time (rawStoreDaemon).
> It would be better for the footprint to free daemon threads when they
> are not used or to recycle them in a pool (like JDK Executor).
>
I think you misunderstand.
The footprint isn't the code running but the jar file being downloaded.
Look, I think everyone agrees that on the micro level, there are always
fixes that should go in to the code.
My point is that on a macro level, a lot of small code enhancements add up.
You're increasing the footprint of the code base which makes it more
difficult to embed in to some applications. Derby was a lightweight
database. Things like raw partitions, fragmented tables, etc ... weren't an
issue.
Is anyone thinking of these things on a macro level? And what direction do
you want to take Derby? Do you want to compete against MySQL or Postgres for
mindshare?
Do you want to build in shared nothing features for distributed queries and
make derby a data warehouse engine?
My suggestion is to review derby and determine how you can satisfy both
needs.
Does that make sense?
-Mike
PS. The example: " The issue is that if a Derby system is
booted with 1,000 databases, then 1,000 backgound threads are created,
all just to handle background work. The to-list item was intended change
the DaemonFactory from being booted per-database to being booted
per-system. Thus a single backgound thread would handle the idle
requests. Then, I agree, the DaemonFactory could be enhanced to support
a handful of worker threads behind the interface, without the knowledge
of the caller."
Don't you think you'd want to revisit the design of a derby system opening
up 1000 databases at a time? With respect to a centralized mail archive
system, you do have other design choices, like a centralized server...
Re: Many background threads (rawStoreDaemon)
Posted by Arnaud Masson <am...@gmail.com>.
derby@segel.com a écrit :
>
>> -----Original Message-----
>>
>>>> I have an application that opens several small derby databases (using
>>>> EmbeddedDriver).
>>>> Most of of these instances don't handle many requests.
>>>> The problem is that each instance maintain its own thread
>>>> "derby.rawStoreDaemon".
>>>> Is there a way to use a thread pool shared between instances instead ?
>>>> (There is also a discussion about that here:
>>>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
>>>>
>>> I am not aware any progress has been made on this issue, unfortunately.
>>>
>> If you think it should be adressed, filing a JIRA issue is a good first
>> step: https://issues.apache.org/jira/browse/DERBY
>>
>> (I don't think there is one filed yet, is it?)
>>
>
> Ok so if I understand this...
>
> A person wants to open multiple embedded copies of a database and then
> thread pool the database server connections/controllers of the individual
> database connections.
>
> Ok, yes there is some merit to this. Unfortunately, you're adding a lot of
> weight to the code that means a larger footprint making it harder to embed.
>
>
This is not about connection pool.
This is about the fact that each derby instance maintain a thread that
is sleeping most of the time (rawStoreDaemon).
It would be better for the footprint to free daemon threads when they
are not used or to recycle them in a pool (like JDK Executor).
RE: Many background threads (rawStoreDaemon)
Posted by de...@segel.com.
> -----Original Message-----
> >> I have an application that opens several small derby databases (using
> >> EmbeddedDriver).
> >> Most of of these instances don't handle many requests.
> >> The problem is that each instance maintain its own thread
> >> "derby.rawStoreDaemon".
> >> Is there a way to use a thread pool shared between instances instead ?
> >> (There is also a discussion about that here:
> >> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
> >
> > I am not aware any progress has been made on this issue, unfortunately.
>
> If you think it should be adressed, filing a JIRA issue is a good first
> step: https://issues.apache.org/jira/browse/DERBY
>
> (I don't think there is one filed yet, is it?)
Ok so if I understand this...
A person wants to open multiple embedded copies of a database and then
thread pool the database server connections/controllers of the individual
database connections.
Ok, yes there is some merit to this. Unfortunately, you're adding a lot of
weight to the code that means a larger footprint making it harder to embed.
This is why I've periodically have had to ask... what is the direction you
want Derby to take?
Do you want a small footprint lightweight database, or do you want more
features that you will find in a more commercial database?
If you say 'both' then you've got to do a lot of refactoring to allow for
some sort of 'plug n play' class loader or even jar builder which allows you
to pick and choose which features you want to run within your engine.
An example... being able to set a property value that indicates which (if
any) encryption algorithm you want to use within derby. (md5,WPA,AES,
twofish...) Then when you build derby for deployment, you only include the
packages you need. Or if you had a feature like table partitioning, you
could decide to include it, or not.
But that would be a radical change and a lot of work to be done for a 'free'
community project. Unless you're a Phd candidate with time on their
hands... do you really want to dive in to this?
Sorry for the soap box. Its Monday and the capitalism in me is waking up.
;-)
-Mike
Re: Many background threads (rawStoreDaemon)
Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Dag.Wanvik@Sun.COM (Dag H. Wanvik) writes:
> Arnaud Masson <am...@gmail.com> writes:
>
>> I have an application that opens several small derby databases (using
>> EmbeddedDriver).
>> Most of of these instances don't handle many requests.
>> The problem is that each instance maintain its own thread
>> "derby.rawStoreDaemon".
>> Is there a way to use a thread pool shared between instances instead ?
>> (There is also a discussion about that here:
>> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
>
> I am not aware any progress has been made on this issue, unfortunately.
If you think it should be adressed, filing a JIRA issue is a good first
step: https://issues.apache.org/jira/browse/DERBY
(I don't think there is one filed yet, is it?)
--
Knut Anders
Re: Many background threads (rawStoreDaemon)
Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Arnaud Masson <am...@gmail.com> writes:
> I have an application that opens several small derby databases (using
> EmbeddedDriver).
> Most of of these instances don't handle many requests.
> The problem is that each instance maintain its own thread
> "derby.rawStoreDaemon".
> Is there a way to use a thread pool shared between instances instead ?
> (There is also a discussion about that here:
> http://osdir.com/ml/apache.db.derby.devel/2005-04/msg00093.html)
I am not aware any progress has been made on this issue, unfortunately.
Dag