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 Tue, 13 Mar 2007 14:37:09 GMT

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

Olav Sandstaa commented on DERBY-2020:
--------------------------------------

Thanks for the comments, Knut Anders. I will go through the comments and update the references
to "rws".

As for a solution to the JVM bug in some VMs on MAC, I was not aware
about the difference in how this bug(s) manifested itself when opening
in rws and rwd mode. I have read to comments in the workaround and in
DERBY-1. If I understand it correctly we need at least open a file
once in rws mode in order to decide if we have this bug. Right now
this is done the first time LogToFile.openLogFileInWriteMode() is
called. I want to change this to always use rwd instead of rws, but
this will not detect this problem. Some possible solutions could be:

1. The first time LogToFile.openLogFileInWriteMode() is called, try to
   open the file in rws mode to see if we get the exception. If no
   exception is thrown, re-open the file in rwd mode. If an exception
   is thrown revert to use rw mode.

2. Move this check to DirStorageFactory4.supportsRws(). Today, this
   function will return true for all JVMs 1.4.2 or newer. I think it
   might be more logical to have a check in this method to determine
   if there are any issues that should prevent us from using rws or
   rwd. For instance, the first time this method was called we could:

     1. Create a file in Derby's tmp directory using "rw" mode.
     2. Close it.
     3. Reopen the file in rws mode.
     4. If an exception is thrown, then make the method return false
        (ie. this JVM does not support rws/rwd).

I think alternative 2 is a cleaner approach. Since I do not have a
machine running Mac OS I will have no way to actually test that this
works. I will make a patch for it hoping that someone will test it
out.


> 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: 10.3.0.0
>            Reporter: Olav Sandstaa
>         Assigned To: Olav Sandstaa
>         Attachments: disk-cache.png, 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.


Mime
View raw message