System designGuide

Machine vision image retention within a storage limit

Keep machine vision image retention within a storage limit using safe ingest, oldest-first cleanup, capacity calculations and recovery tests.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01Choose retention behavior before choosing hardware
  2. 02Separate incoming, archive and protected records
  3. 03Calculate the incoming rate and useful history
  4. 04Set thresholds with room for delayed cleanup
  5. 05Make oldest-first cleanup deterministic
  6. 06Use supported scheduling on an isolated system
  7. 07Check source-side parts without confusing them with retention
  8. 08Test failure and recovery before production
  9. 09Finish with an operating checklist
  10. 10Questions

An image archive should reach a predictable operating size without interrupting image acquisition or deleting files still being transferred. That requires more than setting a folder quota. You need a completion rule, an oldest-first retention policy, enough capacity between cleanup runs, and a defined response when storage becomes unavailable.

For an isolated inspection station, these functions can run on a storage appliance with supported retention features or on a supported host. The design below separates incoming transfers from retained evidence and shows how to size, verify and recover the archive.

Choose retention behavior before choosing hardware

A quota limits consumption, but it normally rejects further writes when the limit is reached. It does not inherently remove the oldest image. Look for an explicitly documented rolling-retention function, or implement that function through a supported application and scheduler.

Also define what “within a storage limit” means. A periodically cleaned archive can temporarily exceed its cleanup threshold. A strict admission-controlled archive must make room before accepting another completed file. Neither approach removes the need to reserve space for incoming transfers.

Approach What happens near the limit Appropriate use
Hard quota only New writes fail when the quota is exhausted Final containment, not continuous retention
Scheduled oldest-first cleanup Usage rises between runs, then falls after deletion Systems with measured headroom and acceptable cleanup delay
Admission-controlled retention Completed files enter the archive only after capacity is available Tightly bounded archive size with controlled file promotion
Documented storage-appliance retention Behavior follows the supported feature and its settings Appliances whose deletion, scheduling and recovery behavior meet the requirement

For most inspection archives, scheduled cleanup with separate high and low thresholds is straightforward. Use admission control when a temporary threshold overshoot is unacceptable. Keep a hard quota as a final boundary, not as the normal operating mechanism.

Before deciding which images deserve retention, distinguish routine production evidence from investigation records. The discussion of inspection image archiving and upload queues helps frame that decision, even when your destination remains entirely local.

Separate incoming, archive and protected records

Use distinct locations with different responsibilities:

  • Incoming: receives transfers that may still be incomplete.
  • Archive: contains completed, validated images eligible for ordinary retention.
  • Quarantine: holds failed or ambiguous transfers under a separate size and age limit.
  • Protected records: contains explicitly retained evidence outside automatic deletion, with its own capacity allocation.

A cleanup account should have deletion rights only within its managed archive. It should not delete application settings, calibration files, inspection models or unrelated shares. Apply the same restriction to its credentials and configured paths.

Promote a file from incoming to archive only after confirming completion. Prefer a documented transfer-completion event, temporary-name convention or application acknowledgment. A rename within the same filesystem can provide an atomic visibility change where the filesystem and service document that behavior. A move across filesystems generally becomes a copy followed by deletion, so do not assume equivalent protection.

Unchanged size and modification time are weaker evidence. A stalled writer can appear inactive while still owning an incomplete transfer. If polling is unavoidable, combine a conservative observation interval with format validation and documented transfer behavior.

A file that opens successfully may still be the wrong frame or an incomplete inspection record. Check expected dimensions, associated metadata and inspection identity. The recording writer setup and cleanup checks explain why a created file is not proof of a completed recording.

Calculate the incoming rate and useful history

Size the archive from the images actually saved, not the camera's maximum acquisition rate. Include every camera, saved exposure, inspection result and accompanying metadata file.

For uncompressed image payloads, use:

Payload bytes per image = width × height × channels × bytes per channel Incoming bytes per second = saved images per second × average stored bytes per image Approximate retained duration = archive bytes / incoming bytes per second

Compressed sizes vary with scene content and encoding settings. Measure representative production images, including unusually detailed scenes and rejected parts. Use a conservative rate for capacity protection and the measured average for estimating typical history.

For a hypothetical monochrome image measuring 4000 × 3000 pixels with one byte per pixel:

Payload = 4000 × 3000 × 1 × 1 = 12,000,000 bytes = 12 MB At 2 saved images per second: Incoming rate = 2 × 12 MB = 24 MB/s Hourly payload = 24 × 3600 = 86,400 MB = 86.4 GB

These calculations use decimal units: 1 MB equals 1,000,000 bytes, and 1 GB equals 1,000,000,000 bytes. File headers, allocation overhead and metadata increase actual consumption. Storage reporting may use different units, so normalize measurements before comparing them.

At this example rate, an archive fluctuating between 550 GB and 650 GB holds approximately:

Minimum approximate history = 550 / 86.4 = 6.4 hours Maximum approximate history = 650 / 86.4 = 7.5 hours

These are steady-rate estimates, not guaranteed evidence windows. Reject-only saving can produce a sudden increase during a process fault. Include that condition in your rate measurement.

Set thresholds with room for delayed cleanup

Use a high threshold to start deletion and a lower target to stop it. The gap prevents repeated deletion of tiny batches whenever usage crosses one boundary.

Reserve capacity for the delay until the next cleanup, cleanup execution time, incoming files, quarantine and filesystem overhead. The following is a planning check rather than a filesystem guarantee:

Required capacity allowance ≥ H + R × (T + D) + B + M H = archive high threshold R = conservative incoming storage rate T = maximum interval between cleanup starts D = allowed cleanup execution or recovery delay B = separately bounded incoming and quarantine usage M = additional accounting and operating margin

Consider a dedicated storage allocation with these hypothetical settings:

Planning quantity Example value
Usable storage available to the station 1000 GB
Dedicated hard quota 800 GB
Archive high threshold 650 GB
Archive cleanup target 550 GB
Incoming rate 24 MB/s
Cleanup interval 300 s
Allowed cleanup delay 60 s
Incoming and quarantine allowance 20 GB
Additional margin 50 GB

The planning calculation is:

New data during interval and delay = 24 MB/s × (300 + 60) s = 8640 MB = 8.64 GB Required allowance = 650 + 8.64 + 20 + 50 = 728.64 GB

That fits beneath the example 800 GB quota under the stated assumptions. It does not protect against an unlimited outage or an unbounded incoming folder. Measure cleanup duration at the expected file count and alarm when either delay or staging consumption exceeds its allowance.

The 100 GB threshold gap represents about 69 minutes of incoming data at the example rate. This reduces cleanup frequency, but deleting that amount must remain practical on the selected storage system.

Check what the quota actually counts. Snapshots, recycle bins, protected records and filesystem metadata may have different accounting rules. A falling archive total does not necessarily mean physical free space has increased.

Make oldest-first cleanup deterministic

The retention worker should operate only on completed archive entries. For each run, use this sequence:

  1. Confirm the intended storage volume is mounted and writable. Check a configured volume identity or marker, not merely whether a directory exists.
  2. Acquire a single-worker lock so overlapping scheduled runs cannot delete or promote files concurrently.
  3. Read current archive consumption and available capacity using a consistent accounting method.
  4. Build an eligible-file list that excludes protected records, temporary files and incomplete inspection groups.
  5. Sort by a stable retention key, then delete eligible entries until usage reaches the lower target.
  6. Record deleted bytes, file count, oldest remaining entry, failures and elapsed time.
  7. Release the lock and publish a success or failure status.

Choose the retention key deliberately. A capture timestamp is useful only if its source and clock behavior are understood. A persisted arrival sequence can be more predictable when camera clocks reset or files arrive late. Add a unique tie-breaker so equal timestamps produce repeatable ordering.

Where an inspection consists of several images and a result record, treat that set as one retention unit. Deleting individual members can leave misleading evidence. For frame identity across separate processing stages, use the principles in matching asynchronous results to frames.

Limit each cleanup run by time or batch size so deletion cannot monopolize storage indefinitely. If the worker cannot reach its target within that budget, raise an alarm rather than silently treating the run as successful.

For strict admission control, calculate the incoming object's accounted size while holding the archive-management lock. Remove eligible records until the object fits, then promote it. Reject or queue an object larger than the entire archive allowance; repeatedly deleting history cannot solve that case.

Use supported scheduling on an isolated system

A storage appliance's operating system does not, by itself, guarantee a supported scripting environment. Confirm that the documented configuration provides persistent scheduling, required permissions, logging and a supported runtime.

Prefer the appliance's supported retention feature when it provides the required behavior. Otherwise, use its documented task mechanism or a supported host scheduler. Obtain software and firmware through the manufacturer or its authorized distribution channels.

Verify that the schedule survives a restart and configuration restore. Do not depend on undocumented edits that firmware maintenance might replace. Keep an offline copy of the approved configuration and a recovery procedure appropriate to the isolated station.

Isolation also does not remove security requirements. Use separate administrative and transfer accounts, restrict reachable services, and allow only required network paths. If a legacy transfer protocol is necessary, document its security limitations and assess whether the isolated network provides adequate protection.

Define what happens when archiving fails. Depending on your traceability requirement, the system may queue records, mark an inspection as unarchived, reject a production result, or request a controlled process stop. Any machine stopping behavior belongs in the approved control and safety design, not in an improvised storage script.

Keep acquisition and archive processing decoupled where practical. The acquisition stall isolation guide covers the boundary between capture, downstream work and recovery when a slow consumer affects the pipeline.

Check source-side parts without confusing them with retention

Changing a camera or cable does not create a rolling archive. Source-side choices matter because they determine image volume and transport behavior, while the receiving application or storage system manages retention.

The LS-CMR-0166 is a USB3 area scan camera. Use its catalog information to assess the image source, then measure the files your application actually writes.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

The LS-CBL-0219 is a USB3.0 camera cable. Confirm connector compatibility, routing and the complete acquisition path before selecting it; this is not a storage-network cable recommendation.

Cables3 m USB3.0 camera cable, high-flex (drag chain) (LS-CBL-0219)LS-CBL-0219$62.00View partBuild a system with it

Compare alternative area scan cameras in the camera finder, and check cables through the accessory finder when specifying the source connection.

If an existing inspection platform uses vision controllers, confirm which documented export, queue and failure-reporting functions its software provides. Do not infer archive management from the presence of camera ports or local storage.

ComputersVision controllers

Vision computers and fanless industrial PCs

190 models · from $1,119.00

For several image sources, the multi-camera capture design guide helps identify shared bandwidth and processing constraints before you calculate the combined saved-image rate.

Test failure and recovery before production

Test against disposable images in a dedicated test archive. Use a deliberately small allowance so threshold crossings occur quickly, while preserving the same control logic intended for production.

For example, set a 2 GB high threshold and a 1.5 GB cleanup target. Feed known files with recorded identities and verify that the oldest eligible inspection groups disappear first. Confirm that protected records and active transfers remain untouched.

Then exercise the failure cases that can invalidate an otherwise correct retention policy:

  • Interrupt a transfer and verify that the partial file never becomes ordinary archive evidence.
  • Restart the storage service and confirm scheduling, locks and configuration recover correctly.
  • Start two cleanup attempts and verify that only one worker acts.
  • Disconnect the storage path and confirm the application does not write into an unintended local directory.
  • Change the clock and verify deterministic ordering without unexpected mass deletion.
  • Fill quarantine and protected-record allocations to their limits.
  • Make deletion fail through test permissions and confirm that the failure becomes visible.
  • Restore an archived inspection group and verify that its images and metadata remain usable.

Test quota exhaustion separately from threshold cleanup. The expected outcome is a reported write failure or other documented response, not silent loss or endless retrying.

Monitor physical free space as well as archive size. Snapshots or recycle-bin behavior can retain deleted data, while an unrelated process can consume the remaining volume. RAID redundancy is not a substitute for recoverable copies of evidence that must survive storage failure.

Finish with an operating checklist

Before accepting the archive design, confirm:

  • Retention objective: required history, protected evidence and deletion authority are documented.
  • Measured rate: normal production and high-save fault conditions both fit the capacity calculation.
  • Completion boundary: only finished inspection records enter the deletion-managed archive.
  • Capacity boundaries: incoming, quarantine, protected records and archive consumption are individually controlled.
  • Deletion behavior: oldest-first order, group handling and threshold accounting are repeatable.
  • Persistence: supported scheduling and configuration survive restart and recovery.
  • Failure response: operators can distinguish capture failure, transfer failure and cleanup failure.
  • Recovery: a retained inspection can be found, opened and matched to its result record.

Scheduled cleanup is the wrong answer when required evidence cannot be deleted automatically, incoming demand is unbounded, or the storage platform cannot support persistent retention tasks. In those cases, change the capacity, admission policy or approved storage platform before commissioning.

Bring your measured file sizes, save rate, required history and storage platform details to application support. If you are also selecting the image source, start with the camera configurator and keep the retention requirements alongside the acquisition specification.

Questions

Does a storage quota automatically delete the oldest images?

A quota normally prevents additional writes after its limit is reached. Automatic oldest-first removal requires a separate retention function, either documented by the storage platform or implemented through a supported application. Confirm the exact behavior rather than assuming a quota provides a rolling archive.

How often should image archive cleanup run?

Choose the interval from the maximum incoming data rate and available headroom. Allow for both the wait until the next run and the time needed to finish cleanup. A shorter interval cannot compensate for deletion that consistently runs slower than the archive grows.

How can cleanup avoid deleting files that are still uploading?

A documented transfer-completion signal or temporary-file promotion convention is preferable. Stable size alone is not sufficient because a stalled transfer can remain unchanged. Validate the image and its inspection identity before admitting it to the archive managed by retention.

Does an isolated vision station need another computer for retention?

A supported appliance feature may provide everything required. Otherwise, a supported host or appliance task mechanism must run the retention logic. Verify scheduling persistence, permissions, monitoring and restart recovery before deciding whether additional computing hardware is necessary.

What should happen when the archive cannot accept another image?

Define the response from the inspection's traceability requirements. Options include bounded queuing, reporting an unarchived result or requesting a controlled process stop through the approved machine design. Test the selected response, including recovery after storage becomes available again.