db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olav Sandstaa (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2020) Change file option for syncing log file to disk from rws to rwd
Date Mon, 16 Apr 2007 21:40:15 GMT

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

Olav Sandstaa commented on DERBY-2020:

Thanks for comments, Suresh. 

1) The reason for creating a new file "rwstest.tmp" was due to I wanted to be able to have
this check done early and in a single place during the boot of the log system. At the place
I decided to add the test the boot code does not know the name of the first log file and a
log file does not even have to exist at that time. I did not want to have to scan the log
directory to be able to find an existing log file that could be used for testing. 

2) I think your comment about read only databases are very valid. By reading the code it seems
like my new code could end up throwing exceptions that would not be handled properly and lead
to failed start-ups for read-only databases.

I will address both of these issues by moving the testing for this JVM bug into the method
LogToFile.openLogFileInWriteMode(). At this point Derby both know the name of the log file
to be opened first and this code will not be called for the readonly db cases. The only "drawback"
by having this code in this method is that there will be need for some extra logic to ensure
that this check is only run once.

> Change file option for syncing log file to disk from rws to rwd
> ---------------------------------------------------------------
>                 Key: DERBY-2020
>                 URL: https://issues.apache.org/jira/browse/DERBY-2020
>             Project: Derby
>          Issue Type: Improvement
>          Components: Performance, Store
>    Affects Versions:
>            Reporter: Olav Sandstaa
>         Assigned To: Olav Sandstaa
>         Attachments: disk-cache.png, jvmsyncbug.diff, jvmsyncbug.stat, jvmsyncbug_v2.diff,
jvmsyncbug_v2.stat, no-disk-cache.png, rwd.diff, rwd.stat
> For writing the transaction log to disk Derby uses a
> RandomAccessFile. If it is supported by the JVM, the log files are
> opened in "rws" mode making the file system take care of syncing
> writes to disk. "rws" mode will ensure that both the data and the file
> meta-data is updated for every write to the file. On some operating
> systems (e.g. Solaris) this leads to two write operation to the disk
> for every write issued by Derby. This is limiting the throughput of
> update intensive applications.  If we could change the file mode to
> "rwd" this could reduce the number of updates to the disk.
> I have run some simple tests where I have changed mode from "rws" to
> "rwd" for the Derby log file. When running a small numbers of
> concurrent client threads the throughput is almost doubled and the
> response time is almost halved. I will attach some graphs that show
> this when running a given number of concurrent "tpc-b" like clients. These
> graphs show the throughput when running with "rws" and "rwd" mode when the
> disk's write cache has been enabled and disabled.
> I am creating this Jira to have a place where we can collect
> information about issues both for and against changing the default
> mode for writing to log files.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message