Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2020

Change file option for syncing log file to disk from rws to rwd

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.1.4
    • 10.3.1.4
    • Store
    • None
    • Normal
    • Release Note Needed
    • Performance

    Description

      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.

      Attachments

        1. disk-cache.png
          4 kB
          Olav Sandstaa
        2. no-disk-cache.png
          4 kB
          Olav Sandstaa
        3. rwd.diff
          0.6 kB
          Olav Sandstaa
        4. rwd.stat
          0.1 kB
          Olav Sandstaa
        5. jvmsyncbug.diff
          5 kB
          Olav Sandstaa
        6. jvmsyncbug.stat
          0.2 kB
          Olav Sandstaa
        7. jvmsyncbug_v2.diff
          5 kB
          Olav Sandstaa
        8. jvmsyncbug_v2.stat
          0.2 kB
          Olav Sandstaa
        9. jvmsyncbug_v3.diff
          5 kB
          Olav Sandstaa
        10. jvmsyncbug_v3.stat
          0.2 kB
          Olav Sandstaa
        11. rwd_pre.diff
          6 kB
          Olav Sandstaa
        12. rwd_pre.stat
          0.5 kB
          Olav Sandstaa
        13. rwd_v2.diff
          1 kB
          Olav Sandstaa
        14. releaseNote.html
          4 kB
          Myrna van Lunteren
        15. releaseNote.html
          4 kB
          Myrna van Lunteren
        16. releaseNote.html
          4 kB
          Myrna van Lunteren

        Activity

          People

            olav Olav Sandstaa
            olav Olav Sandstaa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: