Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5746

Slow file extend when innodb_use_fallocate=1 and SSD file storage

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.36, 10.0.8
    • Fix Version/s: 5.5.37, 10.0.9
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fusion-IO SSD

      Description

      Currently size is set like:

      current_size = 0;
      desired_size = (ib_int64_t)size + (((ib_int64_t)size_high) << 32);

      #ifdef HAVE_POSIX_FALLOCATE
      if (srv_use_posix_fallocate) {

      if (posix_fallocate(file, current_size, desired_size) == -1) {

      Thus file size is always extended from offset 0 to desired offset. This is clearly slower than doing

      posix_fallocate(real_current_size, desired_size)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            jplindst Jan Lindström added a comment -

            revno: 4098
            message:
            MDEV-5746: Slow file extend when innodb_use_fallocate=1 and SSD
            file storage.

            Analysis: posix_fallocate was called using 0 as offset and len as
            desired size. This is not optimal for SSDs.

            Fix: Call posix_fallocate with correct offset i.e. current file size
            and extend the file from there len bytes.

            Show
            jplindst Jan Lindström added a comment - revno: 4098 message: MDEV-5746 : Slow file extend when innodb_use_fallocate=1 and SSD file storage. Analysis: posix_fallocate was called using 0 as offset and len as desired size. This is not optimal for SSDs. Fix: Call posix_fallocate with correct offset i.e. current file size and extend the file from there len bytes.
            Hide
            jplindst Jan Lindström added a comment -

            revno: 4008
            branch nick: 10.0
            message:
            MDEV-5746: Slow file extend when innodb_use_fallocate=1 and SSD
            file storage.

            Analysis: posix_fallocate was called using 0 as offset and len as
            desired size. This is not optimal for SSDs.

            Fix: Call posix_fallocate with correct offset i.e. current file size
            and extend the file from there len bytes.

            Show
            jplindst Jan Lindström added a comment - revno: 4008 branch nick: 10.0 message: MDEV-5746 : Slow file extend when innodb_use_fallocate=1 and SSD file storage. Analysis: posix_fallocate was called using 0 as offset and len as desired size. This is not optimal for SSDs. Fix: Call posix_fallocate with correct offset i.e. current file size and extend the file from there len bytes.

              People

              • Assignee:
                jplindst Jan Lindström
                Reporter:
                jplindst Jan Lindström
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h