Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* fsync slowness + XFS -- Regd.
@ 2019-03-19  2:10 Jeno P
  2019-03-19  5:32 ` Valdis Klētnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Jeno P @ 2019-03-19  2:10 UTC (permalink / raw)
  To: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 1206 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1773 bytes --]

<div dir="ltr">Dear folks,<div><br></div><div>Hoping all are doing good.</div><div><br></div><div><b>Issue</b>:- Slowness in fsync()</div><div><br></div><div><b>System details</b>:-</div><div><br></div><div>OS:- CentOS Linux <b>7.4</b><br></div><div>Linux Kernel:- <b>3.10.0-514 x86-64</b><br></div><div>File system:- <b>XFS</b></div><div><br></div><div><br></div><div>One of my module <i>(C/C++)</i> is writing to log files and periodically flushes it using <i>fsync()</i>. Even for small amount of data, <i>fsync</i> is taking more time <i>(&gt;15 seconds)</i> than expected. Consequently, the main process was timed-out and got killed. Confirmed the slowness through strace. Observed the same behavior with <i>fsync</i> alternatives - <i>fdatasync &amp; syncfs </i>as well<i>. </i>The odd thing is even with very very minimal disk I/O, same issue is happening. Did anybody face the issue ? </div><br class="gmail-m_-8681128221808104971gmail-Apple-interchange-newline"><div><br></div><div>I saw in this forum that performance improvements with respect to <i>fysnc</i> has already been made in file systems <i>ext2, ext3, brtfs</i> and <i>f2fs </i>in latest Kernels. I saw a similar improvement in quite old Kernel <i>(2.6.34)</i>  for <i>XFS</i>. But, I didn&#39;t see any such improvements <i>(for XFS)</i> in <b>newer Kernels</b>. 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 ?</div><div><br></div><div><br></div><div>Looking forward to hear back from you all.</div><div><b><br></b></div><div>Thanks,</div><div>Jeno</div><div class="gmail-yj6qo"></div><br class="gmail-Apple-interchange-newline"></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fsync slowness + XFS -- Regd.
  2019-03-19  2:10 fsync slowness + XFS -- Regd Jeno P
@ 2019-03-19  5:32 ` Valdis Klētnieks
  2019-03-19  6:06   ` Alex Painemilla
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis Klētnieks @ 2019-03-19  5:32 UTC (permalink / raw)
  To: Jeno P; +Cc: kernelnewbies

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fsync slowness + XFS -- Regd.
  2019-03-19  5:32 ` Valdis Klētnieks
@ 2019-03-19  6:06   ` Alex Painemilla
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Painemilla @ 2019-03-19  6:06 UTC (permalink / raw)
  To: Valdis Klētnieks; +Cc: Jeno P, kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 911 bytes --]

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
>

[-- Attachment #1.2: Type: text/html, Size: 1404 bytes --]

<div dir="ltr">Another possibility could be that the disk is in sleep mode and it needs to wake up (A feature enabled on most green drives)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 19, 2019 at 5:03 PM Valdis Klētnieks &lt;<a href="mailto:valdis.kletnieks@vt.edu">valdis.kletnieks@vt.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 19 Mar 2019 07:40:29 +0530, Jeno P said:<br>
<br>
&gt; One of my module *(C/C++)* is writing to log files and periodically flushes<br>
&gt; it using *fsync()*. Even for small amount of data, *fsync* is taking more<br>
&gt; time *(&gt;15 seconds)* than expected.<br>
<br>
Is it possible that some other process is applying a file lock to the log file?<br>
Any signs of I/O errors? 15 seconds is the sort of delay you might see on a<br>
RAID controller with one dead or partially dead disk throwing timeouts...<br>
<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19  2:10 fsync slowness + XFS -- Regd Jeno P
2019-03-19  5:32 ` Valdis Klētnieks
2019-03-19  6:06   ` Alex Painemilla

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox