LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can timed loop clock be WRONG?

Sorry for haven't tried your VI until now. On my computer I did not notice the described delay against the real world time.

Chunk size 6400, file size 0,4 GB, buffered, average writing speed around 20 MB/s (varies from 15 to 24)

0 Kudos
Message 21 of 39
(1,990 Views)

I'll return to this thread when I have again access to the system under test, and more accurate data.

 

Anyhow:

 

in reply to Phillip: IIUC, opening the file as unbuffered, as reccommended by the several streaming resources, should circumvent what you say. Indeed my VI (which is anyway derived from an example posted there) provides the option of checking both ways, and buffered (normal) file write matches the jumpiness you describe.

 

in reply to Jeff: If there are more accurate timers available, the standing question is why LV choses to rely on one rather than the other. Any explanation is allowed, but I'd really want to know it. Once more, here we're talking of a factor 2. No need to be scientifically referenced to see that, visually, on a stopwatch, over a minute of observation.

A quick check I can do, next time I'm there, is whether the standard taskbar windows clock delays or not, when I hog the raid.

 

In reply to Jörn: I also don't see delays if I write at such low speed.

 

Enrico

0 Kudos
Message 22 of 39
(1,971 Views)

Enrico Segre wrote:

in reply to Jeff: If there are more accurate timers available, the standing question is why LV choses to rely on one rather than the other. Any explanation is allowed, but I'd really want to know it. Once more, here we're talking of a factor 2. No need to be scientifically referenced to see that, visually, on a stopwatch, over a minute of observation.

A quick check I can do, next time I'm there, is whether the standard taskbar windows clock delays or not, when I hog the raid.

 


The more accurate timers that are available all have one thing in common.  They are not part of the machine OS- they are generated by external equipment.  LV can be configured to read the timing information from these sources.  The native timing functions, quite rightly, depend on the only timing sources REQUIRED by Windows - The System Clock and the mSec timer.


"Should be" isn't "Is" -Jay
Message 23 of 39
(1,953 Views)

I want just to add a bottom line here, as I sort of promised it earlier in the thread, but had not access to the full data for a while.

 

It turned out that, odd as it was, the RAID controller used then (LSI Logic MegaRAID SAS 84016E RAID Controller, with 9 SATA disks) was responsible for slowing down the OS clock of a factor of roughly two when hogged. Since then we replaced it with an LSI MegaRAID SAS 9260-8i, with 8 carefully matched SATA disks, and the problem ceased to show up, while write throughput significantly increased (we're at 820Mb/s beginning of the disk, now). I, and our computer vendor either, don't have any explanation for what observed, but I have to concede, as for the readout of the timed loop tick, LV was correct - the OS was all the way wrong.

 

Thanks for all the suggestions, anyway,

Enrico

Message 24 of 39
(1,877 Views)
Enrico, if you're still hanging around the forums, can you provide any additional info about your streaming method? I'm currently working with a 12-disk RAID0, and can't get anywhere near 800MB/sec even with SSDs.  I'd be curious to know how you're handling the writes to disk - I'm doing unbuffered writes from a queue to a single file, but I think a lot of my time is taken up by ensuring that my data is sector-sized.  I don't yet know if this is the bottleneck or if the RAID performance is.
0 Kudos
Message 25 of 39
(1,747 Views)

Hi Wired,

 

There can be many things that effect the performance of the raid volume. In the case above the MegaRAID 9260-8i uses the storport driver and the the 84016E used scsi which made a big difference.

 

One of the biggest causes of performance hit across RAID is a situation known as Read Modify Write. This is when you need to modify a block of data on the hard disk on a raid to have to read the data from the disk modify the data as selected and then write the data back. The ideal situation is when you write full blocks accross a disk and/or array (as in RAID 5/6).

 

To compound this most RAID Cards can only have so many transactions in flight and since latency is the biggest issue here performance takes a big hit. This gets compounded even further when disk through is relative to block size size, as well as position of the head on the hard disk.

 

I attached a few links that should help you out.

 

Understand RAID - This is a basic raid primer

 

An Introduction to Streaming - A great resource for getting started with streaming

 

 

Hope this helps please let us know if you have more questions

 

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 26 of 39
(1,713 Views)

Thanks for the links, Joe.  I had already found all of them, but it's nice to see them all in one place.  The information presented is way too basic for my needs, though.

 

0 Kudos
Message 27 of 39
(1,703 Views)

Hi Wired,

 

Can you give me more info and I will do the best to figure out what is going on.

 

What are you raid settings and card?

Can you attach your Project?

 

 

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 28 of 39
(1,701 Views)

I hate to thread-jack here, but I think at the moment the bottleneck is not my RAID, it's the routine I use to write the data to disk.  I have a queue of variable-length strings that need to be sequentially written to a single file, and since the file writes are unbuffered, they need to be sector-sized writes.  I have multiple DAQ devices as well as some other devices all feeding these variable-length strings to the logging queue.  In it's own loop, my routine is dequeueing elements, reformatting them to be sector-sized, and writing them to disk with a Binary File Write.  I don't know if it's the actual memory copy from the dequeue to the file write or sector size formatting that's biting me, but something in that process is slowing me down.  If I just dequeue the element into nowhere (no data sink), my throughput is great. If I add the sector size formatting (basically everything I need to do up to but not including the file write), I definitiely see the performance hit. So I think it's that part of the process I need to work on before I deal with the RAID issue. Problem is, I think it's already pretty well optimized. 

 

P.S. - I can't just pad the strings to a sector size. My file format doesn't allow it.

Message Edited by wired on 06-16-2010 03:00 PM
0 Kudos
Message 29 of 39
(1,694 Views)

Hi wired,

 

I can only talk in light of my experience of last year, but still, maybe some tip can help you.

First of all, you should check if your raid array is at all capable of the write rate you're seeking. Do it with dumb writes of a fixed array, multiple of the sector size, and time the result (double checking them with a stopwatch as my previous experience showed...).  Some snippet like the one I attached in the first message of this thread -  since then I had improved versions of it, but I'd have to search. Mandatorily this has to be unbuffered writes, and the size of what is written at once may be critical - expect the optimum around some MB, perhaps related to disk and controller cache sizes. Only after that you should check for additional bottlenecks due to a) the fact that you're getting the data to be streamed from somewhere, and b) you may need to preprocess it before streaming - both operations may in practice severely interfere with the data transfer to the controller.

 

My previous attempts showed that there are hidden, or at least very obscure (to me) bottlenecks in every step involved. The RAID controller may simply not be up to the task. (My computer vendor, which I consider quite knowledgeable, and who went a long way to help out, forwarded me that it was nearly impossible to get, even from reputable hardware producers like Adaptec or LSI, real statements about performance of their controllers - nobody seemed to really care about RAID0, specs given were extrapolated and not truly measured, and so on). The Raid controller may sit on a bandwidth limited bus (in my case it was a PCI-e x4 behaving like x1, vs a true PCI-e x8, or sitting on the south rather than the nort bridge, and so on). Experiment a lot. Be prepared that performance may not upscale linearly with the number of disks connected. In my case I think we observed linear speed increase with up to 4 or five disks, then saturation (btw - I've also checked at that time different splitting and logical striping strategies of the available disk set at the OS level, but none could do what the controller itself was unable to do). It is usually easy to change the controller configuration on the fly, for that. Know also that the write speed is at best N times that of the worst disk, so if you have a single subperforming HD, it will spoil the whole performance. On 12 magnetic HD I guess that the chance of at least one subperforming is high; presumably not with SSD (which for me were both out of budget and not large enough).

 

When you have assessed that the array performs as requested, you can check further a) and b). As for a), I was sworn not (in my case - PCI-e is PTP conceived, DMA bandwidth is certainly way larger than needed), but still strongly suspect that some kind of motherboard arbitrage interfered with my framegrabber on one side pushing data to RAM and the RAID controller accessing RAM to downloload it on the other. My tests at this level checked for grabbing data continuosly discarded to RAM, AND at the same time trying to write dummy blocks to RAID. I was doing video, and the solution there was to get rid of the NI-1429 grabber in favour of a more recent Karbon one.

 

At the third step you should deal with the processing of your data. Keep in mind that any reshaping, truncating, padding the data to sector multiple may involve huge memcopies, which still steal RAM access time slots - and perhaps prevent the next data transfer to happen at the right time (?). Also here I'm speculating about what really went on with my motherboard, but to be on the safe side I strived not to do any - streaming write just takes the pointer of the beginning of the array and dumps the segment to the controller.

 

Hope this helps (and is not too trivial)

 

Good luck,

 

Enrico

Message 30 of 39
(1,688 Views)