From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: multipart/alternative; boundary=Apple-Mail-42E6509C-0CF6-4D68-B7B2-EB20171A88AE Mime-Version: 1.0 (1.0) Subject: Re: bug in logging code? From: Jens Axboe In-Reply-To: Date: Thu, 3 Apr 2014 23:05:15 -0600 Content-Transfer-Encoding: 7bit Message-Id: <27C33847-D9A1-441C-87C1-6D660078F16F@kernel.dk> References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> <533C55E8.1010108@gmail.com> <533C5D2F.1080308@kernel.dk> <533C755D.1070601@gmail.com> <533CD452.7080205@kernel.dk> To: Andrey Kuzmin Cc: "fio@vger.kernel.org" List-ID: --Apple-Mail-42E6509C-0CF6-4D68-B7B2-EB20171A88AE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On Apr 3, 2014, at 10:58 PM, Andrey Kuzmin wrote= : >=20 > Another reduction idea would be to open/read/write io logs via gz frontend= , defaulting to regular I/O where compression is either unavailable or undes= ired. Should be a big deal with large logs, which is often the case. I plann= ed to take on this in my spare time couple of months back, but it's still wh= ere it was at that time :(. >=20 Should be trivial to wire up actually, the network code already does gz of l= ogs.=20 --Apple-Mail-42E6509C-0CF6-4D68-B7B2-EB20171A88AE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On Apr 3, 2014, at 10:58 PM, Andrey Kuzmin <andrey.v.kuzmin@gmail.com> wrote:

Another reduction idea would be to open/read/write io logs via gz frontend, defaulting to regular I/O where compression is either unavailable or undesired. Should be a big deal with large logs, which is often the case. I planned to take on this in my spare time couple of months back, but it's still where it was at that time :(.

Should be trivial to wire up actually, the network code already does gz of logs. 

--Apple-Mail-42E6509C-0CF6-4D68-B7B2-EB20171A88AE-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <533CD452.7080205@kernel.dk> References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> <533C55E8.1010108@gmail.com> <533C5D2F.1080308@kernel.dk> <533C755D.1070601@gmail.com> <533CD452.7080205@kernel.dk> Date: Thu, 3 Apr 2014 21:58:17 -0700 Message-ID: Subject: Re: bug in logging code? From: Andrey Kuzmin Content-Type: multipart/alternative; boundary=047d7b1600b1b6dc5504f6305d20 To: Jens Axboe Cc: fio@vger.kernel.org List-ID: --047d7b1600b1b6dc5504f6305d20 Content-Type: text/plain; charset=UTF-8 Another reduction idea would be to open/read/write io logs via gz frontend, defaulting to regular I/O where compression is either unavailable or undesired. Should be a big deal with large logs, which is often the case. I planned to take on this in my spare time couple of months back, but it's still where it was at that time :(. On Apr 2, 2014 8:30 PM, "Jens Axboe" wrote: > On 2014-04-02 14:38, Mark Nelson wrote: > >> On 04/02/2014 01:55 PM, Jens Axboe wrote: >> >>> On 04/02/2014 12:24 PM, Mark Nelson wrote: >>> >>>> On 04/02/2014 12:55 PM, Jens Axboe wrote: >>>> >>>>> On 04/02/2014 11:53 AM, Mark Nelson wrote: >>>>> >>>>>> On 04/02/2014 12:38 PM, Jens Axboe wrote: >>>>>> >>>>>>> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>>>>>> >>>>>>>> I've been playing around with usng the various write_*_log >>>>>>>> options in >>>>>>>> fio to record run statistics. What I'm finding is that some of the >>>>>>>> logs >>>>>>>> have malformed lines in them. The following snippet is from the bw >>>>>>>> log: >>>>>>>> >>>>>>>> 811820, 12263, 0, 4194304 >>>>>>>> 812619, 35929, 0, 4194304 >>>>>>>> 818437, 8448, 0, 419430, 4194304 >>>>>>>> 1256299, 160627, 0, 4194304 >>>>>>>> 1256831, 154274, 0, 4194304 >>>>>>>> >>>>>>>> Notice that the malformed line appears to be a partial write that >>>>>>>> gets >>>>>>>> truncated. The fio command being used to run the tests is >>>>>>>> autogenerated, so job files aren't used. here's the one that >>>>>>>> created >>>>>>>> the above log snippet: >>>>>>>> >>>>>>>> /home/nhm/bin/fio >>>>>>>> --rw=read >>>>>>>> --ioengine=libaio >>>>>>>> --runtime=7200 >>>>>>>> --ramp_time=0 >>>>>>>> --numjobs=1 >>>>>>>> --direct=1 >>>>>>>> --bs=4194304B >>>>>>>> --iodepth=16 >>>>>>>> --size=9216M >>>>>>>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra- >>>>>>>> 00004096/client_ra-00000128/op_size-04194304/concurrent_ >>>>>>>> procs-008/iodepth-016/read/output >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/ >>>>>>>> client_ra-00000128/op_size-04194304/concurrent_procs-008/ >>>>>>>> iodepth-016/read/output >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/ >>>>>>>> client_ra-00000128/op_size-04194304/concurrent_procs-008/ >>>>>>>> iodepth-016/read/output >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --time_based >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>>>>>>> >>>>>>>> The --numjobs=1 line should be removed, but I believe it gets >>>>>>>> overridden >>>>>>>> anyway with multiple name parameters. I wonder if having multiple >>>>>>>> name >>>>>>>> parameters (ie multiple fio processes) is causing those processes to >>>>>>>> all >>>>>>>> try to write to the same log files, potentially at the same time? >>>>>>>> Any >>>>>>>> thoughts would be much appreicated! >>>>>>>> >>>>>>> >>>>>>> What version of fio are you running? >>>>>>> >>>>>>> >>>>>> f42557f (ie master from yesterday) with a slightly different fix for >>>>>> the >>>>>> basename issues that just got resolved. >>>>>> >>>>>> I can verify now that running fio with a single --name flag appears to >>>>>> generate logs without malformated lines. >>>>>> >>>>> >>>>> OK, I'll take a look, We should already be serializing the writing to >>>>> the same log files, but your example definitely looks like we are not. >>>>> >>>>> BTW, the numjobs option applies to each --name section. Just to clear >>>>> that up from your original email. So you really get numjobs * >>>>> name_sections running. >>>>> >>>> >>>> Aha, thanks for clearing that up! >>>> >>>> Is github the right place to create new issues? If so, want me to >>>> create one for this? >>>> >>> >>> Sure, you can go ahead and do that. >>> >> >> Actually, I'm going to wait after hearing your response below! >> >> >>> I'm puzzled by this report. The writeout of the logs is fully >>> serialized, there should be no interleaving. Looking at your output, >>> it's definitely either the output from two jobs, or mangled output from >>> just one job. The corrupted line is at time 818437, and the next line is >>> much further ahead. Normally you would expect to see: >>> >>> 500, some-bw, 0, blocksize <- job X >>> 1000, some-bw, 0, blocksize >>> [...] >>> end-time, some-bw, 0, blocksize <- last entry from job X >>> 500, some-bw, 0, blocksize <- job Y now starts >>> >>> Note that the log writing always appends. Did you possibly have this >>> half-done files in that location from a previous run? >>> >> >> I think this is possible. My tool is supposed to clean out old tmp >> directories but it was broken (and unnoticed because all other output >> files were getting overwritten each time). Guess I should prioritize a >> long-standing plan to use UUIDs for all tests/directories to make this >> kind of bug more obvious. :) >> > > That makes me feel better, and does make a lot more sense! But since I was > looking at this code anyway, I could not help but be annoyed at how we > serialize all the logs when writing them out. If the logs are big, it can > take a long time per log. So I added some code to only lock per file > instead. This means that if no log sharing is happening, we'll write all 5 > logs in parallel. A quick test here with a 5s null run which resulted in 4 > logs (two tiny, the bw and iops log) reduced the log writing from 26 > seconds to 14 seconds. And that was just two 18M logs. > > So even if we didn't have a real bug here, at least the logging is now > substantially faster. > > -- > Jens Axboe > > -- > 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 > --047d7b1600b1b6dc5504f6305d20 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Another reduction idea would be to open/read/write io logs v= ia gz frontend, defaulting to regular I/O where compression is either unava= ilable or undesired. Should be a big deal with large logs, which is often t= he case. I planned to take on this in my spare time couple of months back, = but it's still where it was at that time :(.

On Apr 2, 2014 8:30 PM, "Jens Axboe" &= lt;axboe@kernel.dk> wrote:
On 2014-04-02 14:38, Mark Nelson wrote:
On 04/02/2014 01:55 PM, Jens Axboe wrote:
On 04/02/2014 12:24 PM, Mark Nelson wrote:
On 04/02/2014 12:55 PM, Jens Axboe wrote:
On 04/02/2014 11:53 AM, Mark Nelson wrote:
On 04/02/2014 12:38 PM, Jens Axboe wrote:
On 04/02/2014 09:23 AM, Mark Nelson wrote:
I've been playing around with usng the various write_*_log
options in
fio to record run statistics. =C2=A0What I'm finding is that some of th= e
logs
have malformed lines in them. =C2=A0The following snippet is from the bw log:

811820, 12263, 0, 4194304
812619, 35929, 0, 4194304
818437, 8448, 0, 419430, 4194304
1256299, 160627, 0, 4194304
1256831, 154274, 0, 4194304

Notice that the malformed line appears to be a partial write that
gets
truncated. =C2=A0The fio command being used to run the tests is
autogenerated, so job files aren't used. =C2=A0here's the one that<= br> created
the above log snippet:

/home/nhm/bin/fio
--rw=3Dread
--ioengine=3Dlibaio
--runtime=3D7200
--ramp_time=3D0
--numjobs=3D1
--direct=3D1
--bs=3D4194304B
--iodepth=3D16
--size=3D9216M
--write_iops_log=3D/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/cl= ient_ra-00000128/op_size-04194304/concurrent_procs-008/iodept= h-016/read/output







--write_bw_log=3D/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/clie= nt_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-= 016/read/output







--write_lat_log=3D/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/cli= ent_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth= -016/read/output







--time_based
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6
--name=3D/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7

The --numjobs=3D1 line should be removed, but I believe it gets
overridden
anyway with multiple name parameters. =C2=A0I wonder if having multiple
name
parameters (ie multiple fio processes) is causing those processes to
all
try to write to the same log files, potentially at the same time?
Any
thoughts would be much appreicated!

What version of fio are you running?


f42557f (ie master from yesterday) with a slightly different fix for
the
basename issues that just got resolved.

I can verify now that running fio with a single --name flag appears to
generate logs without malformated lines.

OK, I'll take a look, We should already be serializing the writing to the same log files, but your example definitely looks like we are not.

BTW, the numjobs option applies to each --name section. Just to clear
that up from your original email. So you really get numjobs *
name_sections running.

Aha, thanks for clearing that up!

Is github the right place to create new issues? =C2=A0If so, want me to
create one for this?

Sure, you can go ahead and do that.

Actually, I'm going to wait after hearing your response below!


I'm puzzled by this report. The writeout of the logs is fully
serialized, there should be no interleaving. Looking at your output,
it's definitely either the output from two jobs, or mangled output from=
just one job. The corrupted line is at time 818437, and the next line is much further ahead. Normally you would expect to see:

500, some-bw, 0, blocksize =C2=A0 =C2=A0 =C2=A0 =C2=A0<- job X
1000, some-bw, 0, blocksize
[...]
end-time, some-bw, 0, blocksize =C2=A0 =C2=A0 =C2=A0 =C2=A0<- last entry= from job X
500, some-bw, 0, blocksize =C2=A0 =C2=A0 =C2=A0 =C2=A0<- job Y now start= s

Note that the log writing always appends. Did you possibly have this
half-done files in that location from a previous run?

I think this is possible. =C2=A0My tool is supposed to clean out old tmp directories but it was broken (and unnoticed because all other output
files were getting overwritten each time). =C2=A0Guess I should prioritize = a
long-standing plan to use UUIDs for all tests/directories to make this
kind of bug more obvious. :)

That makes me feel better, and does make a lot more sense! But since I was = looking at this code anyway, I could not help but be annoyed at how we seri= alize all the logs when writing them out. If the logs are big, it can take = a long time per log. So I added some code to only lock per file instead. Th= is means that if no log sharing is happening, we'll write all 5 logs in= parallel. A quick test here with a 5s null run which resulted in 4 logs (t= wo tiny, the bw and iops log) reduced the log writing from 26 seconds to 14= seconds. And that was just two 18M logs.

So even if we didn't have a real bug here, at least the logging is now = substantially faster.

--
Jens Axboe

--
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 =C2=A0http://vger.kernel.org/majordomo-info.htm= l
--047d7b1600b1b6dc5504f6305d20-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <533CD452.7080205@kernel.dk> Date: Wed, 02 Apr 2014 21:24:02 -0600 From: Jens Axboe MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> <533C55E8.1010108@gmail.com> <533C5D2F.1080308@kernel.dk> <533C755D.1070601@gmail.com> In-Reply-To: <533C755D.1070601@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Mark Nelson , fio@vger.kernel.org List-ID: On 2014-04-02 14:38, Mark Nelson wrote: > On 04/02/2014 01:55 PM, Jens Axboe wrote: >> On 04/02/2014 12:24 PM, Mark Nelson wrote: >>> On 04/02/2014 12:55 PM, Jens Axboe wrote: >>>> On 04/02/2014 11:53 AM, Mark Nelson wrote: >>>>> On 04/02/2014 12:38 PM, Jens Axboe wrote: >>>>>> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>>>>>> I've been playing around with usng the various write_*_log >>>>>>> options in >>>>>>> fio to record run statistics. What I'm finding is that some of the >>>>>>> logs >>>>>>> have malformed lines in them. The following snippet is from the bw >>>>>>> log: >>>>>>> >>>>>>> 811820, 12263, 0, 4194304 >>>>>>> 812619, 35929, 0, 4194304 >>>>>>> 818437, 8448, 0, 419430, 4194304 >>>>>>> 1256299, 160627, 0, 4194304 >>>>>>> 1256831, 154274, 0, 4194304 >>>>>>> >>>>>>> Notice that the malformed line appears to be a partial write that >>>>>>> gets >>>>>>> truncated. The fio command being used to run the tests is >>>>>>> autogenerated, so job files aren't used. here's the one that >>>>>>> created >>>>>>> the above log snippet: >>>>>>> >>>>>>> /home/nhm/bin/fio >>>>>>> --rw=read >>>>>>> --ioengine=libaio >>>>>>> --runtime=7200 >>>>>>> --ramp_time=0 >>>>>>> --numjobs=1 >>>>>>> --direct=1 >>>>>>> --bs=4194304B >>>>>>> --iodepth=16 >>>>>>> --size=9216M >>>>>>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> --time_based >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>>>>>> >>>>>>> The --numjobs=1 line should be removed, but I believe it gets >>>>>>> overridden >>>>>>> anyway with multiple name parameters. I wonder if having multiple >>>>>>> name >>>>>>> parameters (ie multiple fio processes) is causing those processes to >>>>>>> all >>>>>>> try to write to the same log files, potentially at the same time? >>>>>>> Any >>>>>>> thoughts would be much appreicated! >>>>>> >>>>>> What version of fio are you running? >>>>>> >>>>> >>>>> f42557f (ie master from yesterday) with a slightly different fix for >>>>> the >>>>> basename issues that just got resolved. >>>>> >>>>> I can verify now that running fio with a single --name flag appears to >>>>> generate logs without malformated lines. >>>> >>>> OK, I'll take a look, We should already be serializing the writing to >>>> the same log files, but your example definitely looks like we are not. >>>> >>>> BTW, the numjobs option applies to each --name section. Just to clear >>>> that up from your original email. So you really get numjobs * >>>> name_sections running. >>> >>> Aha, thanks for clearing that up! >>> >>> Is github the right place to create new issues? If so, want me to >>> create one for this? >> >> Sure, you can go ahead and do that. > > Actually, I'm going to wait after hearing your response below! > >> >> I'm puzzled by this report. The writeout of the logs is fully >> serialized, there should be no interleaving. Looking at your output, >> it's definitely either the output from two jobs, or mangled output from >> just one job. The corrupted line is at time 818437, and the next line is >> much further ahead. Normally you would expect to see: >> >> 500, some-bw, 0, blocksize <- job X >> 1000, some-bw, 0, blocksize >> [...] >> end-time, some-bw, 0, blocksize <- last entry from job X >> 500, some-bw, 0, blocksize <- job Y now starts >> >> Note that the log writing always appends. Did you possibly have this >> half-done files in that location from a previous run? > > I think this is possible. My tool is supposed to clean out old tmp > directories but it was broken (and unnoticed because all other output > files were getting overwritten each time). Guess I should prioritize a > long-standing plan to use UUIDs for all tests/directories to make this > kind of bug more obvious. :) That makes me feel better, and does make a lot more sense! But since I was looking at this code anyway, I could not help but be annoyed at how we serialize all the logs when writing them out. If the logs are big, it can take a long time per log. So I added some code to only lock per file instead. This means that if no log sharing is happening, we'll write all 5 logs in parallel. A quick test here with a 5s null run which resulted in 4 logs (two tiny, the bw and iops log) reduced the log writing from 26 seconds to 14 seconds. And that was just two 18M logs. So even if we didn't have a real bug here, at least the logging is now substantially faster. -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-ID: <533C755D.1070601@gmail.com> Date: Wed, 02 Apr 2014 15:38:53 -0500 From: Mark Nelson MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> <533C55E8.1010108@gmail.com> <533C5D2F.1080308@kernel.dk> In-Reply-To: <533C5D2F.1080308@kernel.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Jens Axboe , fio@vger.kernel.org List-ID: On 04/02/2014 01:55 PM, Jens Axboe wrote: > On 04/02/2014 12:24 PM, Mark Nelson wrote: >> On 04/02/2014 12:55 PM, Jens Axboe wrote: >>> On 04/02/2014 11:53 AM, Mark Nelson wrote: >>>> On 04/02/2014 12:38 PM, Jens Axboe wrote: >>>>> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>>>>> I've been playing around with usng the various write_*_log options in >>>>>> fio to record run statistics. What I'm finding is that some of the >>>>>> logs >>>>>> have malformed lines in them. The following snippet is from the bw >>>>>> log: >>>>>> >>>>>> 811820, 12263, 0, 4194304 >>>>>> 812619, 35929, 0, 4194304 >>>>>> 818437, 8448, 0, 419430, 4194304 >>>>>> 1256299, 160627, 0, 4194304 >>>>>> 1256831, 154274, 0, 4194304 >>>>>> >>>>>> Notice that the malformed line appears to be a partial write that >>>>>> gets >>>>>> truncated. The fio command being used to run the tests is >>>>>> autogenerated, so job files aren't used. here's the one that created >>>>>> the above log snippet: >>>>>> >>>>>> /home/nhm/bin/fio >>>>>> --rw=read >>>>>> --ioengine=libaio >>>>>> --runtime=7200 >>>>>> --ramp_time=0 >>>>>> --numjobs=1 >>>>>> --direct=1 >>>>>> --bs=4194304B >>>>>> --iodepth=16 >>>>>> --size=9216M >>>>>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> --time_based >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>>>>> >>>>>> The --numjobs=1 line should be removed, but I believe it gets >>>>>> overridden >>>>>> anyway with multiple name parameters. I wonder if having multiple >>>>>> name >>>>>> parameters (ie multiple fio processes) is causing those processes to >>>>>> all >>>>>> try to write to the same log files, potentially at the same time? >>>>>> Any >>>>>> thoughts would be much appreicated! >>>>> >>>>> What version of fio are you running? >>>>> >>>> >>>> f42557f (ie master from yesterday) with a slightly different fix for >>>> the >>>> basename issues that just got resolved. >>>> >>>> I can verify now that running fio with a single --name flag appears to >>>> generate logs without malformated lines. >>> >>> OK, I'll take a look, We should already be serializing the writing to >>> the same log files, but your example definitely looks like we are not. >>> >>> BTW, the numjobs option applies to each --name section. Just to clear >>> that up from your original email. So you really get numjobs * >>> name_sections running. >> >> Aha, thanks for clearing that up! >> >> Is github the right place to create new issues? If so, want me to >> create one for this? > > Sure, you can go ahead and do that. Actually, I'm going to wait after hearing your response below! > > I'm puzzled by this report. The writeout of the logs is fully > serialized, there should be no interleaving. Looking at your output, > it's definitely either the output from two jobs, or mangled output from > just one job. The corrupted line is at time 818437, and the next line is > much further ahead. Normally you would expect to see: > > 500, some-bw, 0, blocksize <- job X > 1000, some-bw, 0, blocksize > [...] > end-time, some-bw, 0, blocksize <- last entry from job X > 500, some-bw, 0, blocksize <- job Y now starts > > Note that the log writing always appends. Did you possibly have this > half-done files in that location from a previous run? I think this is possible. My tool is supposed to clean out old tmp directories but it was broken (and unnoticed because all other output files were getting overwritten each time). Guess I should prioritize a long-standing plan to use UUIDs for all tests/directories to make this kind of bug more obvious. :) Mark > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <533C5D2F.1080308@kernel.dk> Date: Wed, 02 Apr 2014 12:55:43 -0600 From: Jens Axboe MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> <533C55E8.1010108@gmail.com> In-Reply-To: <533C55E8.1010108@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Mark Nelson , fio@vger.kernel.org List-ID: On 04/02/2014 12:24 PM, Mark Nelson wrote: > On 04/02/2014 12:55 PM, Jens Axboe wrote: >> On 04/02/2014 11:53 AM, Mark Nelson wrote: >>> On 04/02/2014 12:38 PM, Jens Axboe wrote: >>>> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>>>> I've been playing around with usng the various write_*_log options in >>>>> fio to record run statistics. What I'm finding is that some of the >>>>> logs >>>>> have malformed lines in them. The following snippet is from the bw >>>>> log: >>>>> >>>>> 811820, 12263, 0, 4194304 >>>>> 812619, 35929, 0, 4194304 >>>>> 818437, 8448, 0, 419430, 4194304 >>>>> 1256299, 160627, 0, 4194304 >>>>> 1256831, 154274, 0, 4194304 >>>>> >>>>> Notice that the malformed line appears to be a partial write that gets >>>>> truncated. The fio command being used to run the tests is >>>>> autogenerated, so job files aren't used. here's the one that created >>>>> the above log snippet: >>>>> >>>>> /home/nhm/bin/fio >>>>> --rw=read >>>>> --ioengine=libaio >>>>> --runtime=7200 >>>>> --ramp_time=0 >>>>> --numjobs=1 >>>>> --direct=1 >>>>> --bs=4194304B >>>>> --iodepth=16 >>>>> --size=9216M >>>>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> --time_based >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>>>> >>>>> The --numjobs=1 line should be removed, but I believe it gets >>>>> overridden >>>>> anyway with multiple name parameters. I wonder if having multiple >>>>> name >>>>> parameters (ie multiple fio processes) is causing those processes to >>>>> all >>>>> try to write to the same log files, potentially at the same time? Any >>>>> thoughts would be much appreicated! >>>> >>>> What version of fio are you running? >>>> >>> >>> f42557f (ie master from yesterday) with a slightly different fix for the >>> basename issues that just got resolved. >>> >>> I can verify now that running fio with a single --name flag appears to >>> generate logs without malformated lines. >> >> OK, I'll take a look, We should already be serializing the writing to >> the same log files, but your example definitely looks like we are not. >> >> BTW, the numjobs option applies to each --name section. Just to clear >> that up from your original email. So you really get numjobs * >> name_sections running. > > Aha, thanks for clearing that up! > > Is github the right place to create new issues? If so, want me to > create one for this? Sure, you can go ahead and do that. I'm puzzled by this report. The writeout of the logs is fully serialized, there should be no interleaving. Looking at your output, it's definitely either the output from two jobs, or mangled output from just one job. The corrupted line is at time 818437, and the next line is much further ahead. Normally you would expect to see: 500, some-bw, 0, blocksize <- job X 1000, some-bw, 0, blocksize [...] end-time, some-bw, 0, blocksize <- last entry from job X 500, some-bw, 0, blocksize <- job Y now starts Note that the log writing always appends. Did you possibly have this half-done files in that location from a previous run? -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-ID: <533C55E8.1010108@gmail.com> Date: Wed, 02 Apr 2014 13:24:40 -0500 From: Mark Nelson MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> In-Reply-To: <533C4F2B.5070708@kernel.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Jens Axboe , fio@vger.kernel.org List-ID: On 04/02/2014 12:55 PM, Jens Axboe wrote: > On 04/02/2014 11:53 AM, Mark Nelson wrote: >> On 04/02/2014 12:38 PM, Jens Axboe wrote: >>> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>>> I've been playing around with usng the various write_*_log options in >>>> fio to record run statistics. What I'm finding is that some of the >>>> logs >>>> have malformed lines in them. The following snippet is from the bw >>>> log: >>>> >>>> 811820, 12263, 0, 4194304 >>>> 812619, 35929, 0, 4194304 >>>> 818437, 8448, 0, 419430, 4194304 >>>> 1256299, 160627, 0, 4194304 >>>> 1256831, 154274, 0, 4194304 >>>> >>>> Notice that the malformed line appears to be a partial write that gets >>>> truncated. The fio command being used to run the tests is >>>> autogenerated, so job files aren't used. here's the one that created >>>> the above log snippet: >>>> >>>> /home/nhm/bin/fio >>>> --rw=read >>>> --ioengine=libaio >>>> --runtime=7200 >>>> --ramp_time=0 >>>> --numjobs=1 >>>> --direct=1 >>>> --bs=4194304B >>>> --iodepth=16 >>>> --size=9216M >>>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>> >>>> >>>> >>>> >>>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>> >>>> >>>> >>>> >>>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>> >>>> >>>> >>>> >>>> --time_based >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>>> >>>> The --numjobs=1 line should be removed, but I believe it gets >>>> overridden >>>> anyway with multiple name parameters. I wonder if having multiple name >>>> parameters (ie multiple fio processes) is causing those processes to >>>> all >>>> try to write to the same log files, potentially at the same time? Any >>>> thoughts would be much appreicated! >>> >>> What version of fio are you running? >>> >> >> f42557f (ie master from yesterday) with a slightly different fix for the >> basename issues that just got resolved. >> >> I can verify now that running fio with a single --name flag appears to >> generate logs without malformated lines. > > OK, I'll take a look, We should already be serializing the writing to > the same log files, but your example definitely looks like we are not. > > BTW, the numjobs option applies to each --name section. Just to clear > that up from your original email. So you really get numjobs * > name_sections running. Aha, thanks for clearing that up! Is github the right place to create new issues? If so, want me to create one for this? Mark From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <533C4F2B.5070708@kernel.dk> Date: Wed, 02 Apr 2014 11:55:55 -0600 From: Jens Axboe MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> In-Reply-To: <533C4E9D.8050901@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Mark Nelson , fio@vger.kernel.org List-ID: On 04/02/2014 11:53 AM, Mark Nelson wrote: > On 04/02/2014 12:38 PM, Jens Axboe wrote: >> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>> I've been playing around with usng the various write_*_log options in >>> fio to record run statistics. What I'm finding is that some of the logs >>> have malformed lines in them. The following snippet is from the bw log: >>> >>> 811820, 12263, 0, 4194304 >>> 812619, 35929, 0, 4194304 >>> 818437, 8448, 0, 419430, 4194304 >>> 1256299, 160627, 0, 4194304 >>> 1256831, 154274, 0, 4194304 >>> >>> Notice that the malformed line appears to be a partial write that gets >>> truncated. The fio command being used to run the tests is >>> autogenerated, so job files aren't used. here's the one that created >>> the above log snippet: >>> >>> /home/nhm/bin/fio >>> --rw=read >>> --ioengine=libaio >>> --runtime=7200 >>> --ramp_time=0 >>> --numjobs=1 >>> --direct=1 >>> --bs=4194304B >>> --iodepth=16 >>> --size=9216M >>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>> >>> >>> >>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>> >>> >>> >>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>> >>> >>> >>> --time_based >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>> >>> The --numjobs=1 line should be removed, but I believe it gets overridden >>> anyway with multiple name parameters. I wonder if having multiple name >>> parameters (ie multiple fio processes) is causing those processes to all >>> try to write to the same log files, potentially at the same time? Any >>> thoughts would be much appreicated! >> >> What version of fio are you running? >> > > f42557f (ie master from yesterday) with a slightly different fix for the > basename issues that just got resolved. > > I can verify now that running fio with a single --name flag appears to > generate logs without malformated lines. OK, I'll take a look, We should already be serializing the writing to the same log files, but your example definitely looks like we are not. BTW, the numjobs option applies to each --name section. Just to clear that up from your original email. So you really get numjobs * name_sections running. -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-ID: <533C4E9D.8050901@gmail.com> Date: Wed, 02 Apr 2014 12:53:33 -0500 From: Mark Nelson MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> In-Reply-To: <533C4B06.9070108@kernel.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Jens Axboe , fio@vger.kernel.org List-ID: On 04/02/2014 12:38 PM, Jens Axboe wrote: > On 04/02/2014 09:23 AM, Mark Nelson wrote: >> I've been playing around with usng the various write_*_log options in >> fio to record run statistics. What I'm finding is that some of the logs >> have malformed lines in them. The following snippet is from the bw log: >> >> 811820, 12263, 0, 4194304 >> 812619, 35929, 0, 4194304 >> 818437, 8448, 0, 419430, 4194304 >> 1256299, 160627, 0, 4194304 >> 1256831, 154274, 0, 4194304 >> >> Notice that the malformed line appears to be a partial write that gets >> truncated. The fio command being used to run the tests is >> autogenerated, so job files aren't used. here's the one that created >> the above log snippet: >> >> /home/nhm/bin/fio >> --rw=read >> --ioengine=libaio >> --runtime=7200 >> --ramp_time=0 >> --numjobs=1 >> --direct=1 >> --bs=4194304B >> --iodepth=16 >> --size=9216M >> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >> >> >> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >> >> >> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >> >> >> --time_based >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >> >> The --numjobs=1 line should be removed, but I believe it gets overridden >> anyway with multiple name parameters. I wonder if having multiple name >> parameters (ie multiple fio processes) is causing those processes to all >> try to write to the same log files, potentially at the same time? Any >> thoughts would be much appreicated! > > What version of fio are you running? > f42557f (ie master from yesterday) with a slightly different fix for the basename issues that just got resolved. I can verify now that running fio with a single --name flag appears to generate logs without malformated lines. Mark From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <533C4B06.9070108@kernel.dk> Date: Wed, 02 Apr 2014 11:38:14 -0600 From: Jens Axboe MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> In-Reply-To: <533C2B54.6030606@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Mark Nelson , fio@vger.kernel.org List-ID: On 04/02/2014 09:23 AM, Mark Nelson wrote: > I've been playing around with usng the various write_*_log options in > fio to record run statistics. What I'm finding is that some of the logs > have malformed lines in them. The following snippet is from the bw log: > > 811820, 12263, 0, 4194304 > 812619, 35929, 0, 4194304 > 818437, 8448, 0, 419430, 4194304 > 1256299, 160627, 0, 4194304 > 1256831, 154274, 0, 4194304 > > Notice that the malformed line appears to be a partial write that gets > truncated. The fio command being used to run the tests is > autogenerated, so job files aren't used. here's the one that created > the above log snippet: > > /home/nhm/bin/fio > --rw=read > --ioengine=libaio > --runtime=7200 > --ramp_time=0 > --numjobs=1 > --direct=1 > --bs=4194304B > --iodepth=16 > --size=9216M > --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output > > --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output > > --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output > > --time_based > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 > --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 > > The --numjobs=1 line should be removed, but I believe it gets overridden > anyway with multiple name parameters. I wonder if having multiple name > parameters (ie multiple fio processes) is causing those processes to all > try to write to the same log files, potentially at the same time? Any > thoughts would be much appreicated! What version of fio are you running? -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f176.google.com ([209.85.223.176]:40640 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758702AbaDBPW7 (ORCPT ); Wed, 2 Apr 2014 11:22:59 -0400 Received: by mail-ie0-f176.google.com with SMTP id rd18so377034iec.21 for ; Wed, 02 Apr 2014 08:22:59 -0700 (PDT) Received: from [192.168.1.2] (174-20-103-90.mpls.qwest.net. [174.20.103.90]) by mx.google.com with ESMTPSA id ro10sm39876044igb.6.2014.04.02.08.22.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 08:22:58 -0700 (PDT) Message-ID: <533C2B54.6030606@gmail.com> Date: Wed, 02 Apr 2014 10:23:00 -0500 From: Mark Nelson MIME-Version: 1.0 Subject: bug in logging code? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: fio-owner@vger.kernel.org List-Id: fio@vger.kernel.org To: fio@vger.kernel.org I've been playing around with usng the various write_*_log options in fio to record run statistics. What I'm finding is that some of the logs have malformed lines in them. The following snippet is from the bw log: 811820, 12263, 0, 4194304 812619, 35929, 0, 4194304 818437, 8448, 0, 419430, 4194304 1256299, 160627, 0, 4194304 1256831, 154274, 0, 4194304 Notice that the malformed line appears to be a partial write that gets truncated. The fio command being used to run the tests is autogenerated, so job files aren't used. here's the one that created the above log snippet: /home/nhm/bin/fio --rw=read --ioengine=libaio --runtime=7200 --ramp_time=0 --numjobs=1 --direct=1 --bs=4194304B --iodepth=16 --size=9216M --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output --time_based --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 The --numjobs=1 line should be removed, but I believe it gets overridden anyway with multiple name parameters. I wonder if having multiple name parameters (ie multiple fio processes) is causing those processes to all try to write to the same log files, potentially at the same time? Any thoughts would be much appreicated! Thanks, Mark From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-ID: <5385EC2C.6090808@gmail.com> Date: Wed, 28 May 2014 09:01:16 -0500 From: Mark Nelson MIME-Version: 1.0 Subject: Re: bug in logging code? References: <533C2B54.6030606@gmail.com> <533C4B06.9070108@kernel.dk> <533C4E9D.8050901@gmail.com> <533C4F2B.5070708@kernel.dk> <533C55E8.1010108@gmail.com> <533C5D2F.1080308@kernel.dk> <533C755D.1070601@gmail.com> <533CD452.7080205@kernel.dk> In-Reply-To: <533CD452.7080205@kernel.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Jens Axboe , fio@vger.kernel.org List-ID: On 04/02/2014 10:24 PM, Jens Axboe wrote: > On 2014-04-02 14:38, Mark Nelson wrote: >> On 04/02/2014 01:55 PM, Jens Axboe wrote: >>> On 04/02/2014 12:24 PM, Mark Nelson wrote: >>>> On 04/02/2014 12:55 PM, Jens Axboe wrote: >>>>> On 04/02/2014 11:53 AM, Mark Nelson wrote: >>>>>> On 04/02/2014 12:38 PM, Jens Axboe wrote: >>>>>>> On 04/02/2014 09:23 AM, Mark Nelson wrote: >>>>>>>> I've been playing around with usng the various write_*_log >>>>>>>> options in >>>>>>>> fio to record run statistics. What I'm finding is that some of the >>>>>>>> logs >>>>>>>> have malformed lines in them. The following snippet is from the bw >>>>>>>> log: >>>>>>>> >>>>>>>> 811820, 12263, 0, 4194304 >>>>>>>> 812619, 35929, 0, 4194304 >>>>>>>> 818437, 8448, 0, 419430, 4194304 >>>>>>>> 1256299, 160627, 0, 4194304 >>>>>>>> 1256831, 154274, 0, 4194304 >>>>>>>> >>>>>>>> Notice that the malformed line appears to be a partial write that >>>>>>>> gets >>>>>>>> truncated. The fio command being used to run the tests is >>>>>>>> autogenerated, so job files aren't used. here's the one that >>>>>>>> created >>>>>>>> the above log snippet: >>>>>>>> >>>>>>>> /home/nhm/bin/fio >>>>>>>> --rw=read >>>>>>>> --ioengine=libaio >>>>>>>> --runtime=7200 >>>>>>>> --ramp_time=0 >>>>>>>> --numjobs=1 >>>>>>>> --direct=1 >>>>>>>> --bs=4194304B >>>>>>>> --iodepth=16 >>>>>>>> --size=9216M >>>>>>>> --write_iops_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --write_bw_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --write_lat_log=/tmp/cbt/ceph/kvmrbdfio/osd_ra-00004096/client_ra-00000128/op_size-04194304/concurrent_procs-008/iodepth-016/read/output >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --time_based >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-0 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-1 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-2 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-3 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-4 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-5 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-6 >>>>>>>> --name=/srv/rbdfio-`hostname -s`-0/cbt-kvmrbdfio-7 >>>>>>>> >>>>>>>> The --numjobs=1 line should be removed, but I believe it gets >>>>>>>> overridden >>>>>>>> anyway with multiple name parameters. I wonder if having multiple >>>>>>>> name >>>>>>>> parameters (ie multiple fio processes) is causing those >>>>>>>> processes to >>>>>>>> all >>>>>>>> try to write to the same log files, potentially at the same time? >>>>>>>> Any >>>>>>>> thoughts would be much appreicated! >>>>>>> >>>>>>> What version of fio are you running? >>>>>>> >>>>>> >>>>>> f42557f (ie master from yesterday) with a slightly different fix for >>>>>> the >>>>>> basename issues that just got resolved. >>>>>> >>>>>> I can verify now that running fio with a single --name flag >>>>>> appears to >>>>>> generate logs without malformated lines. >>>>> >>>>> OK, I'll take a look, We should already be serializing the writing to >>>>> the same log files, but your example definitely looks like we are not. >>>>> >>>>> BTW, the numjobs option applies to each --name section. Just to clear >>>>> that up from your original email. So you really get numjobs * >>>>> name_sections running. >>>> >>>> Aha, thanks for clearing that up! >>>> >>>> Is github the right place to create new issues? If so, want me to >>>> create one for this? >>> >>> Sure, you can go ahead and do that. >> >> Actually, I'm going to wait after hearing your response below! >> >>> >>> I'm puzzled by this report. The writeout of the logs is fully >>> serialized, there should be no interleaving. Looking at your output, >>> it's definitely either the output from two jobs, or mangled output from >>> just one job. The corrupted line is at time 818437, and the next line is >>> much further ahead. Normally you would expect to see: >>> >>> 500, some-bw, 0, blocksize <- job X >>> 1000, some-bw, 0, blocksize >>> [...] >>> end-time, some-bw, 0, blocksize <- last entry from job X >>> 500, some-bw, 0, blocksize <- job Y now starts >>> >>> Note that the log writing always appends. Did you possibly have this >>> half-done files in that location from a previous run? >> >> I think this is possible. My tool is supposed to clean out old tmp >> directories but it was broken (and unnoticed because all other output >> files were getting overwritten each time). Guess I should prioritize a >> long-standing plan to use UUIDs for all tests/directories to make this >> kind of bug more obvious. :) > > That makes me feel better, and does make a lot more sense! But since I > was looking at this code anyway, I could not help but be annoyed at how > we serialize all the logs when writing them out. If the logs are big, it > can take a long time per log. So I added some code to only lock per file > instead. This means that if no log sharing is happening, we'll write all > 5 logs in parallel. A quick test here with a 5s null run which resulted > in 4 logs (two tiny, the bw and iops log) reduced the log writing from > 26 seconds to 14 seconds. And that was just two 18M logs. > > So even if we didn't have a real bug here, at least the logging is now > substantially faster. > Hi Jens, Sorry to necro this thread. I've been continuing to play with the various write*log options along with bwavgtime and log_avg_msec and trying to make sense of the output. Does each job log a line in the logs or do they get aggregated? Also, when I have a different value for bwavgtime and log_avg_msec (say 500ms default for bwavgtime and 100ms for log_avg_msec), is it first doing the 100ms avg for log_avg_msec and then averaging those for bwavgtime? What is the intended behaviour? My bw logs seem to be showing performance lower than what the aggregate totals in the output file show (and oddities I wasn't expecting), so I'm just trying to get a feel for how things are supposed to work. Mark