fsync slowness + XFS -- Regd.
Dear folks, Hoping all are doing good. *Issue*:- Slowness in fsync() *System details*:- OS:- CentOS Linux *7.4* Linux Kernel:- *3.10.0-514 x86-64* File system:- *XFS* One of my module *(C/C++)* is writing to log files and periodically flushes it using *fsync()*. Even for small amount of data, *fsync* is taking more time *(>15 seconds)* than expected. Consequently, the main process was timed-out and got killed. Confirmed the slowness through strace. Observed the same behavior with *fsync* alternatives - *fdatasync & syncfs *as well *. *The odd thing is even with very very minimal disk I/O, same issue is happening. Did anybody face the issue ? I saw in this forum that performance improvements with respect to *fysnc* has already been made in file systems *ext2, ext3, brtfs* and *f2fs *in latest Kernels. I saw a similar improvement in quite old Kernel *(2.6.34)* for *XFS*. But, I didn't see any such improvements *(for XFS)* in *newer Kernels*. Should I need to downgrade my Kernel and observe the issue ? I fear that downgrading may lead to other performance issues. Is there a patch being planned in latest Kernel for CentOS ? Looking forward to hear back from you all. Thanks, Jeno
On Tue, 19 Mar 2019 07:40:29 +0530, Jeno P said:
One of my module *(C/C++)* is writing to log files and periodically flushes it using *fsync()*. Even for small amount of data, *fsync* is taking more time *(>15 seconds)* than expected.
Is it possible that some other process is applying a file lock to the log file? Any signs of I/O errors? 15 seconds is the sort of delay you might see on a RAID controller with one dead or partially dead disk throwing timeouts...
Another possibility could be that the disk is in sleep mode and it needs to wake up (A feature enabled on most green drives) On Tue, Mar 19, 2019 at 5:03 PM Valdis Klētnieks <valdis.kletnieks@vt.edu> wrote:
On Tue, 19 Mar 2019 07:40:29 +0530, Jeno P said:
One of my module *(C/C++)* is writing to log files and periodically flushes it using *fsync()*. Even for small amount of data, *fsync* is taking more time *(>15 seconds)* than expected.
Is it possible that some other process is applying a file lock to the log file? Any signs of I/O errors? 15 seconds is the sort of delay you might see on a RAID controller with one dead or partially dead disk throwing timeouts...
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (3)
-
Alex Painemilla -
Jeno P -
Valdis Klētnieks