Flexible I/O Tester development
 help / color / mirror / Atom feed
* How to flush the writing cache before a test with read
@ 2010-11-18 19:58 Dan Le
  2010-11-18 21:13 ` Dan Le
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Le @ 2010-11-18 19:58 UTC (permalink / raw)
  To: fio

Greetings,

FIO needs to write data files in order to read them. Without disabling
the write-cache of the disk, I was wondering if there's a way to flush
these data cache to disk right before FIO starts to read these files.

I don't want to run every second "sync && echo 3 >
/proc/sys/vm/drop_caches" at the same time with FIO because of its
incurred overheads. Please help.

Thanks,

Dan

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

* How to flush the writing cache before a test with read
  2010-11-18 19:58 How to flush the writing cache before a test with read Dan Le
@ 2010-11-18 21:13 ` Dan Le
  2010-11-18 22:12   ` Steven Pratt
  2010-11-18 22:32   ` Jenkins, Lee (ISS Houston)
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Le @ 2010-11-18 21:13 UTC (permalink / raw)
  To: fio

Greetings,

FIO needs to write data files in order to read them. Without disabling
the write-cache of the disk, I was wondering if there's a way to flush
these data cache to disk right before FIO starts to read these files.

I don't want to run every second "sync && echo 3 >
/proc/sys/vm/drop_caches" at the same time with FIO because of its
incurred overhead. Please help.

Thank you,

Dan

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

* Re: How to flush the writing cache before a test with read
  2010-11-18 21:13 ` Dan Le
@ 2010-11-18 22:12   ` Steven Pratt
  2010-11-18 22:32   ` Jenkins, Lee (ISS Houston)
  1 sibling, 0 replies; 5+ messages in thread
From: Steven Pratt @ 2010-11-18 22:12 UTC (permalink / raw)
  To: Dan Le; +Cc: fio

Dan Le wrote:
> Greetings,
>
> FIO needs to write data files in order to read them. Without disabling
> the write-cache of the disk, I was wondering if there's a way to flush
> these data cache to disk right before FIO starts to read these files.
>   
Fio does an fsync and an FADVISE_DONT_NEED call after file creation 
phase which causes the cache to be dropped. I have never had a problem 
with files still being in cache when a read test starts.  The only one 
to watch out for is if you repeat the test, the files may be in cache 
from a previous read, as the default behavior is to not delete on 
completion and to not re-create if they already exist.

Steve

> I don't want to run every second "sync && echo 3 >
> /proc/sys/vm/drop_caches" at the same time with FIO because of its
> incurred overhead. Please help.
>
> Thank you,
>
> Dan
> --
> To unsubscribe from this list: send the line "unsubscribe fio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   


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

* RE: How to flush the writing cache before a test with read
  2010-11-18 21:13 ` Dan Le
  2010-11-18 22:12   ` Steven Pratt
@ 2010-11-18 22:32   ` Jenkins, Lee (ISS Houston)
  2010-11-19 14:32     ` Dan Le
  1 sibling, 1 reply; 5+ messages in thread
From: Jenkins, Lee (ISS Houston) @ 2010-11-18 22:32 UTC (permalink / raw)
  To: Dan Le, fio@vger.kernel.org

The safest and least test-intrusive way is to calculate the flush time ahead of time and insert the appropriate wait time into the test. I encountered the same issue when testing RAID volumes attached to (shameless plug) HP Smart Array controllers with battery-backed write cache. When the cache (512MB at max config) was filled with random write data it could take a long time for the flush to complete. It was the only way to ensure that the subsequent read-only test data was accurate.

-----Original Message-----
From: fio-owner@vger.kernel.org [mailto:fio-owner@vger.kernel.org] On Behalf Of Dan Le
Sent: Thursday, November 18, 2010 3:13 PM
To: fio@vger.kernel.org
Subject: How to flush the writing cache before a test with read

Greetings,

FIO needs to write data files in order to read them. Without disabling
the write-cache of the disk, I was wondering if there's a way to flush
these data cache to disk right before FIO starts to read these files.

I don't want to run every second "sync && echo 3 >
/proc/sys/vm/drop_caches" at the same time with FIO because of its
incurred overhead. Please help.

Thank you,

Dan
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: How to flush the writing cache before a test with read
  2010-11-18 22:32   ` Jenkins, Lee (ISS Houston)
@ 2010-11-19 14:32     ` Dan Le
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Le @ 2010-11-19 14:32 UTC (permalink / raw)
  To: Jenkins, Lee (ISS Houston); +Cc: fio@vger.kernel.org

I tried fsync to drop the cache upon 5 - 10 I/Os. So far, it seems to
work to me. I will try with fsync=1 later.

Jenkins, suppose that cache will be cleared out before FIO is
performed, it still can be dirty because of I/Os from other processes
when FIO's writes are performed, how could you accurately calculate
the flush time ahead?  And how could you smoothly handle the wait time
in FIO?

Thanks,

Dan


On Thu, Nov 18, 2010 at 5:32 PM, Jenkins, Lee (ISS Houston)
<Lee.Jenkins@hp.com> wrote:
> The safest and least test-intrusive way is to calculate the flush time ahead of time and insert the appropriate wait time into the test. I encountered the same issue when testing RAID volumes attached to (shameless plug) HP Smart Array controllers with battery-backed write cache. When the cache (512MB at max config) was filled with random write data it could take a long time for the flush to complete. It was the only way to ensure that the subsequent read-only test data was accurate.
>
> -----Original Message-----
> From: fio-owner@vger.kernel.org [mailto:fio-owner@vger.kernel.org] On Behalf Of Dan Le
> Sent: Thursday, November 18, 2010 3:13 PM
> To: fio@vger.kernel.org
> Subject: How to flush the writing cache before a test with read
>
> Greetings,
>
> FIO needs to write data files in order to read them. Without disabling
> the write-cache of the disk, I was wondering if there's a way to flush
> these data cache to disk right before FIO starts to read these files.
>
> I don't want to run every second "sync && echo 3 >
> /proc/sys/vm/drop_caches" at the same time with FIO because of its
> incurred overhead. Please help.
>
> Thank you,
>
> Dan
> --
> To unsubscribe from this list: send the line "unsubscribe fio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

end of thread, other threads:[~2010-11-19 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 19:58 How to flush the writing cache before a test with read Dan Le
2010-11-18 21:13 ` Dan Le
2010-11-18 22:12   ` Steven Pratt
2010-11-18 22:32   ` Jenkins, Lee (ISS Houston)
2010-11-19 14:32     ` Dan Le

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox