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 Vivek Choudhary <vi...@gmail.com> on 2015/02/24 13:31:10 UTC

RawStoreDaemon thread in Derby Embedded Database

Please can someone provide me information regarding the use of
RawStoreDaemon thread in Derby database.

I am pretty new to derby database and was looking for some information
regarding this.

Also, since this is a daemon thread does this impact to any cpu usage
during application runtime.

Thanks.
Vivek Choudhary

Re: RawStoreDaemon thread in Derby Embedded Database

Posted by Kristian Waagan <kr...@apache.org>.
Den 25.03.15 07.48, skrev Vivek Choudhary:
> Thanks Rick, Mike for the information provided about the Daemon thread. 
> It clears some understanding about the significance of these threads.
> 
> In my legacy application it performs following operation - 
> 1. writes data to table under jta transaction boundary (handled by 
> Hibernate)
> 2. scheduled cron job runs in every night to delete old data
> 
> Now, the issue which we are facing is the daemon thread is consuming 
> 100% cpu usage and as result we have to restart our server to get this 
> clear out. After the server restart everything becomes normal.
> 
> Any pointer what would be causing daemon thread to consumes cpu usage?

Hi Vivek,

Are you able to obtain some stack traces from the application when it's
using 100% CPU?


If it is indeed the RawStoreDaemon that's consuming the CPU, the stack
traces might give some clues. Post only the traces for the daemon thread
of you like.

Also, what's the version of your Derby installation?


Regards,
-- 
Kristian

> 
> Thanks.
> Vivek
> 
> 


Re: RawStoreDaemon thread in Derby Embedded Database

Posted by Vivek Choudhary <vi...@gmail.com>.
Thanks Rick, Mike for the information provided about the Daemon thread. 
It clears some understanding about the significance of these threads.

In my legacy application it performs following operation - 
1. writes data to table under jta transaction boundary (handled by 
Hibernate)
2. scheduled cron job runs in every night to delete old data

Now, the issue which we are facing is the daemon thread is consuming 
100% cpu usage and as result we have to restart our server to get this 
clear out. After the server restart everything becomes normal.

Any pointer what would be causing daemon thread to consumes cpu usage?

Thanks.
Vivek



Re: RawStoreDaemon thread in Derby Embedded Database

Posted by mike matrigali <mi...@gmail.com>.
On 2/24/2015 4:31 AM, Vivek Choudhary wrote:
> Please can someone provide me information regarding the use of RawStoreDaemon thread in Derby database.
2 main uses off the top of my head:
1) following events that result in rows being deleted from a page (like deleted, or aborted inserts), derby will
      post work to the daemon thread to be executed after the current transaction commits.  This work involves
      reading the page, getting locks on rows, changing the page if it finds deleted rows are committed, and finally
      committing a separate transaction that will result eventually in writing that page to disk and log related I/O.
2) consistency points.  Derby will schedule a consistency point after a configurable amount of log I/O has completed.
     At that point it schedule work to the daemon thread to cycle through every page in the cache and write those that
     are dirty.  It also writes a log record to the transaction log. Once that work is done the system "knows" that dirty
    pages associated with transactions that committed before that point in the log have been written and that those
    log records are no longer needed for system reboot recovery.
>
> I am pretty new to derby database and was looking for some information regarding this.
>
> Also, since this is a daemon thread does this impact to any cpu usage during application runtime.
yes, though most of the impact is I/O rather than cpu related.
>
> Thanks.
> Vivek Choudhary


-- 
email:    Mike Matrigali - mikemapp1@gmail.com
linkedin: https://www.linkedin.com/in/MikeMatrigali
available for Derby related contract projects.


Re: RawStoreDaemon thread in Derby Embedded Database

Posted by Rick Hillegas <ri...@gmail.com>.
On 2/24/15 4:31 AM, Vivek Choudhary wrote:
> Please can someone provide me information regarding the use of 
> RawStoreDaemon thread in Derby database.
>
> I am pretty new to derby database and was looking for some information 
> regarding this.
>
> Also, since this is a daemon thread does this impact to any cpu usage 
> during application runtime.
>
> Thanks.
> Vivek Choudhary
Hi Vivek,

I am not an expert on this part of the engine, but this is what I 
believe: The rawStoreDaemon is a background thread which performs 
asynchronous writes on behalf of the Derby storage engine. I believe 
that the rawStoreDaemon is responsible for post-commit work. This 
includes flushing committed (logged) writes to the tables and indexes in 
the seg0 directory. The rawStoreDaemon may also be involved in 
roll-forward recovery, that is, the boot-time application of data 
changes which durably committed (were logged) but which weren't flushed 
to disk before an engine crash.

Hope this helps,
-Rick