Skip to main content
Designer and manufacturer of advanced imaging equipment فا

Article

The Saving Cache in ALTRON and What the disk slow Warning Means

rahni

Suppose a line scan camera is running at a high line rate over a conveyor belt and you have started recording. A few seconds later, disk slow appears next to Status and the Cache percentage bar slowly climbs. What does this mean, and what should you do? The answer lies in the saving cache, the memory that sits between the camera and the disk.

Saving nodes at the end of the ALTRON graph
Saving nodes at the end of the ALTRON graph

What exactly does the cache do?

When you press Start on a saving node, any data that reaches the node first goes into an intermediate buffer in RAM, and is written to disk from there.

Disk speed is not constant. Sometimes it slows down for a moment, for example when the operating system is busy with something else. The cache absorbs these momentary slowdowns so the camera data does not have to wait for the disk.

You set its size with Cache Size (MB). You can set it from 1 to 524288 MB; the default is 800. This setting exists in all saving plug-ins, from BMP to video.

Take the percentage bar next to Cache seriously

Next to Cache Size is a percentage bar that shows how full the cache is. If the bar occasionally rises and then drops again, everything is normal. If it keeps rising or reaches 100%, the disk has fallen behind the camera. When the cache is completely full, recording stops.

Where does the disk slow warning come from?

In the BMP, JPEG and TIFF savers, ALTRON compares the disk write speed with the incoming data rate during recording. If data arrives faster than it is written and the cache is filling up, disk slow is added to the Status text.

Hover the mouse over Status. Its tooltip shows both speeds, like this: Written … MB/s < incoming … MB/s – cache filling. These two numbers tell you how big the gap is.

This warning appears before the cache is completely full. So you still have time to act before recording stops.

What to do when the disk falls behind

  1. Make the cache larger. High line or frame rates need a larger cache, but the cache must fit in free RAM. Check RAM usage in the Physical RAM section, below the camera list.
  2. Use a faster disk. A fast SSD usually solves the problem at its root.
  3. Reduce the data. One way is to lower the data rate with ImagingInterval in Max rate mode. On a line scan camera you can also remove the dark margins of the line with Crop Line.
  4. Choose a lighter format. For example, if the image is only for viewing, use JPEG instead of TIFF; JPEG compresses lossily and is not suitable for measurement. If you need TIFF, set Compression to Deflate so fewer bytes reach the disk.

A larger cache only helps when the disk slowdown is temporary. If the average write speed is lower than the average incoming data rate, the cache will eventually fill no matter how large it is; it just takes longer. Then you need one of the other three options: a faster disk, less data or a lighter format.

Stop or Discard and Stop?

Stop ends the recording, but everything left in the cache is fully written to disk. If the cache was full, this writing takes a while. Wait, and do not close the program in the middle of it.

Discard and Stop is the opposite. Recording stops immediately and the unwritten data in the cache is discarded. Files already written to disk stay where they are. When you realize mid-run that the settings were wrong, this option keeps you from ending up with an extra incomplete file.

A good habit from field work

Before the main recording, make a test recording of a few minutes at the real production line rate, and just watch the Cache bar and Status. If disk slow does not appear and the Cache bar does not climb, you can start the long recording with more confidence. The other recording features are explained in ALTRON page.

If you want to read more about the theory behind data buffers, this Wikipedia article (English) is a good start.

If you still run into the disk slow warning on your own system, send us your camera and disk specifications, and we will find the right solution.

Where our equipment is used

Organizations, universities, industries and companies that have used our products

  • Hedayat Hooshmand Nozhan Sepehr