Welcome! Log In Create A New Profile

Advanced

fsync() slowness + XFS

Posted by Jeno 
fsync() slowness + XFS
March 18, 2019 11:31PM
Dear folks,

Hoping all are doing good. I'm a newbie guy to this forum.

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. Would it fix my issue ? I didn't see any such improvements (for XFS) in newer Kernels. Should I need to downgrade my Kernel and observe the behavior ? I fear that downgrading may lead to other performance issues. Is there a patch being planned in newer CentOS Kernels ?


Looking forward to hear back from you.

Thanks,
Jeno
Re: fsync() slowness + XFS
March 18, 2019 11:56PM
Foks,

If you feel that this is the wrong place for my query, please redirect me.

Jeno



Jeno Wrote:
-------------------------------------------------------
> Dear folks,
>
> Hoping all are doing good. I'm a newbie guy to
> this forum.
>
> 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. Would it fix my issue ? I didn't see any
> such improvements (for XFS) in newer
> Kernels
. Should I need to downgrade my Kernel
> and observe the behavior ? I fear that downgrading
> may lead to other performance issues. Is there a
> patch being planned in newer CentOS Kernels ?
>
>
> Looking forward to hear back from you.
>
> Thanks,
> Jeno
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 19 plus 10?
Message: