SUSE Support

Here When You Need Us

Synchronous writes on SLES 12 are slower than on SLES 11

This document (7016100) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 12

Situation

A regression can be observed regarding synchronous write performance compared to SLES 11

Resolution

null

Cause

An application can request each write to be fully written to backing storage before the write(2) system call returns by specifying O_SYNC flag when opening the file. This is implemented in current versions of the Linux kernel by calling fsync(2) before returning from the write(2) system call.

In releases until and including SLES 11, only fdatasync(2) is called, which doesn't fully comply with the POSIX specification. In SLE 12, the behavior has changed to match the specification. This can result in notable performance decline of synchronous writes that do not require allocation of new disk space for the file: while previously no inode changes were written in this specific case,  inodes now need to be updated because file time stamps have changed and fsync(2) mandates updating inodes in such case while fdatasync(2) does not.

Additional Information

In case a regression in the speed of synchronous writes is observed and the guarantees of a full fsync(2) after each write are not necessary for the application, the application can be changed to use the O_DSYNC flag instead of O_SYNC when opening the file. That will make the system call fdatasync(2) after each write and thus behave the same way as it did prior to SLE 12. This may require source code changes to and rebuilding of the application in case it doesn't allow it to be configurable.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7016100
  • Creation Date: 26-Jan-2015
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.