How Ikshana Scales Down: Fitting a Highway into 2 GB of RAM

How Ikshana Scales Down: Fitting a Highway into 2 GB of RAM

Software can be made fast by giving it more hardware. The harder question is what happens when you take the hardware away. When you can’t add memory, can’t add servers and can’t count on the network, every choice in a system has to justify itself, and that’s when you find out whether an architecture was sound or just well-funded.

Scaling down is the harder direction

Our previous tech deep-dive showed Ikshana taking 2.5–3 million events a day from 700+ cameras on seven bare-metal servers. This one goes the other way: the same platform and the same event schema on a 2 GB Raspberry Pi, a 4 GB Jetson Nano and an 8 GB Jetson Orin, ending on a Pi that keeps pace with the Orin.

Four edge builds · memory and workload

Each card is one edge build, and each block is a gigabyte of RAM. All four report to the same central Ikshana.

Scaling up has a safety valve: when a server runs hot, you add a server. Scaling down has none. A 2 GB board does not grow a third gigabyte because traffic got heavy, and a highway does not slow down because the model is busy. So the edge inverts the usual order of work. The budget comes first, and the design is whatever fits inside it.

Scaling up has a safety valve: when a server runs hot, you add a server. Scaling down has none. A 2 GB board does not grow a third gigabyte because traffic got heavy, and a highway does not slow down because the model is busy. So the edge inverts the usual order of work. The budget comes first, and the design is whatever fits inside it.

Budget first: a 2 GB Pi and an OS that wanted a quarter of it

The first edge Ikshana was number-plate recognition on a Raspberry Pi wired to radar, sirens and relays. The models were not the hard part. The Pi had 2 GB of RAM, and the operating system took 400–500 MB before our process had started.

So we treated the stock image as a desktop that had wandered onto a traffic pole and stripped it to what the job needed, with nothing left running that the work did not use. That returned 180–200 MB, which on a 2 GB board is the difference between a model that fits and one that swaps.

The habit outlived the device. Parkinson’s law holds for memory as it does for time: software expands to fill the RAM it is given. Every edge build since has started from the same theory, keep only what is necessary, and that first Pi went on to run the whole loop alone, from capture to relay to central Ikshana, across ANPR and ATCC sites.

One rule: the hot path does one thing

Every deployment since follows one rule. The path from frame to decision carries nothing the next decision does not need. Anything that can block or take an unpredictable time, whether a disk write, an upload, a relay or a log line, is kept off that path and never waited on.

The reason is arithmetic. Four cameras at 12 FPS give the loop 83 ms for four frames, not one. A 30 ms disk write inside it does not cost 30 ms; it costs a frame on every camera, and on a highway that frame can be the one with the plate in it.

Jetson Nano: 48 frames a second through one model

The first multi-camera build was incident detection: slow-moving, stopped and wrong-way vehicles, poor visibility and camera tampering on four cameras, from a Jetson Nano whose 4 GB is shared between CPU and GPU.

Four cameras at 12 FPS is 48 frames a second, a budget of about 20 ms each. The detector’s first build took 60–70 ms, so two frames in three were gone before any logic ran. Tuned for the Nano’s GPU it took 20–23 ms, and the pipeline settled at 41–42 FPS. The front/back classifier that confirms wrong-way driving makes the point more sharply: 12 ms on the GPU against 600–900 ms on the CPU.

A fast model was necessary, not sufficient. Four ideas kept those numbers true under load:

  • A frame queue is a bug waiting for traffic. At 42 FPS against 48 arriving, a queue grows by six frames every second, and after a minute the system is analysing traffic from more than seven seconds ago. So frames are never queued: the newest frame replaces the old one, and staleness is capped at one frame interval at any load.
  • The camera owns the clock. A 15-second stop and the gap between two speed lines are measured in capture timestamps, not processing time, so a busy engine cannot stretch a dwell or distort a speed.
  • Metres, not pixels. A stopped vehicle is one that holds inside a radius set in metres, not pixels, so one threshold works near the camera and far from it.
  • A frozen camera must not look like a stopped vehicle. A repeated frame is caught before it reaches the engine, so a frozen or tampered camera is reported as tampering, not as traffic that has stopped.

Jetson Orin: 14 applications, 6 models, one highway

The highway build runs 14 applications: vehicle class, plate OCR, speed, no seatbelt, no helmet, triple riding, banned vehicle, wrong lane, slow-moving, stopped, wrong-way, pedestrian, animal and poor visibility. Three lane cameras and one overview, six models, one 8 GB Orin.

The target was never FPS. Goodhart’s law applies to pipelines: once frame rate is the goal, it stops measuring what you care about. Negativity bias decides what an operator cares about: the one vehicle that passed unread is remembered long after ten thousand correct reads are forgotten. So the metric became missed vehicles, and the rule became drop frames, never vehicles. Today Ikshana misses 0.2% of vehicles on the busiest highways, in fast traffic: 99.8% accuracy.

Not every model needs every frame. One light stage sees everything, and it decides when the expensive models are worth running.

  • One model always on. Every lane camera’s newest frame goes through the plate model each tick, and across all of them it runs near 120 frames a second.
  • Five models that mostly sleep. The other models run only when there is a vehicle for them to look at, and only the ones that vehicle calls for, so most of the time they are idle.
  • Read the plate when it is closest. Each plate is tracked and read more than once as it approaches, and the best read wins. Speed is measured, not estimated.
  • Nothing slow touches the loop. Saving the image and writing the record cost about 100 ms an event, so none of it happens inside the frame loop. A profiling pass that removed one hidden per-frame cost made the loop five times faster.

The guards against a missed vehicle are small and many. A plate is processed the moment it appears. A track that misbehaves is reset rather than trusted. Finished events wait their turn when storage is slow instead of being dropped. And a vehicle seen by two lane cameras is kept by both rather than risked to de-duplication.

A single Orin handles 75,000–80,000 events a day, every one synced to central Ikshana. The largest highway site runs 20 of these units alongside eight radar units, which run plate OCR and vehicle classification, at 65,000–70,000 events a day each. Together the site sends about 2–2.2 million (20–22 lakh) events a day.

Largest highway site · typical events a day per edge unit

No single unit is large. The site’s volume comes from 28 small boxes working side by side.

Raspberry Pi 5 + AI HAT: the Orin’s workload on 2 GB

The newest build runs the Orin’s full violation set on a Raspberry Pi 5 with 2 GB of RAM and an AI accelerator on the AI HAT: four cameras at 15 FPS each, with frame rates and inference times close to the Orin’s on a quarter of its memory.

It works because the Pi’s CPU no longer runs the models at all. Inference lives entirely on the accelerator, and the Pi is left to decode video, track, decide and sync. Its Python environment carries no deep-learning framework of any kind.

  • An extra camera costs 7 ms, not 16. Adding a camera adds a fraction of the inference time, not a whole copy of it: about 16 ms for one camera and 30 ms for three.
  • The plate model comes first. When the accelerator is contended, plate detection is never the model that waits, because the tracker depends on it. If a plate cannot be read on this frame it is read on a later one, because on a road the same plate comes round again.
  • It heals itself. A run of model failures triggers a full reload, a stuck component is replaced by a watchdog, and nothing is ever left behind holding the accelerator.

Recording without decoding a frame

Every edge unit also records, and recording never competes with the models for the CPU. The camera’s compressed stream is stored as it arrives, without being decoded or re-encoded, so it is close to free. Every file starts decodable, no frame falls between two files, and clips travel to central separately from events, so a video upload never delays a plate read.

One platform: the link is designed to be down

An edge unit is not a separate product. It runs Ikshana, decides locally, and feeds the same central endpoints and event schema as the bare-metal sites of the last post. Central calls it an LPU, a local processing unit, and cannot tell whether a plate read came from a Pi, an Orin or a rack.

A highway unit on a cellular uplink loses the server for minutes at a time, so the design assumes the link is down and treats a connection as a bonus. Every event is committed locally first and pushed to central when the link allows, and whatever fails to send stays queued for the next round. That is store-and-forward with at-least-once delivery, and it means an outage costs delay, not events. A regular heartbeat carries the unit’s health, version and licence state, and central creates the device and its cameras from the first one, so nobody registers an edge unit by hand.

Deciding at the edge also changes what the link has to carry. Central receives events and short evidence clips, not four continuous camera streams from every unit, so a highway site runs on the cellular uplink it already has.

The first events went to central as JSON, with the image inside them as base64: 385–410 KB a request, and about 800 GB a day from one site. Base64 alone was a quarter of that, because it spends four bytes to carry three. Multipart encoding sends the image as raw bytes, and compressing the image did the rest. An event now travels as 75–85 KB, of which the metadata is just 2–3 KB. That is a fivefold cut, and the photo is still on every event.

The same link works between servers. A full central Ikshana can itself report to another Ikshana exactly as an edge unit does: same schema, same store-and-forward, same heartbeat. Edge to server and server to server are one mechanism, so sites roll up into a larger Ikshana without a separate integration. Scaling down is a configuration, not a fork.

100 remote cameras: stream the video or send the events

Take 100 cameras spread over 25 remote sites, four to a site. There are two ways to run analytics on them. Central can pull every stream over the WAN and run the models on its own GPUs. Or each site gets an edge unit beside its cameras, decides there, and sends central only what it decided. In the second design central does low to no video processing: it stores events, serves search and runs the dashboard.

Two ways to run 100 remote cameras · what crosses the WAN

Two ways to run 100 remote cameras · what crosses the WAN

Grey carries continuous video and blue carries events. The cameras, the sites and the dashboard are the same on both sides; only the place where the decision is made has moved.

A 1080p camera encoding H.264 sends about 4 Mbps whether or not anything is in the frame. That is 43 GB a day per camera, 4.3 TB a day for 100, and 400 Mbps arriving at central around the clock. An event is far smaller: 2–3 KB of metadata, or 75–85 KB with its photo. Even at the busiest highway rate from the Orin section, 75,000–80,000 events a day per four-camera unit, 25 units send 140–170 GB a day with photos and 4–6 GB without.

 

Pull the video

Edge: events + photo

Edge: metadata only

What crosses the WAN

100 continuous 1080p streams

2–3 KB record and 75–85 KB photo per event

2–3 KB record per event

Per site, average

16 Mbps

0.5–0.6 Mbps

14–22 kbps

Per site, a month

5.2 TB

170–200 GB

4.5–7 GB

Into central, average

400 Mbps

13–16 Mbps

0.35–0.56 Mbps

Into central, a day

4.3 TB

140–170 GB

4–6 GB

Into central, a month

130 TB

4.2–5.1 TB

110–180 GB

Less data than pulling the video

Baseline

About 96% (25–31× less)

99.9% (720–1,150× less)

Link each site needs

Fibre leased line

4G/5G SIM

4G/5G SIM

The table assumes 25 sites of four cameras, 1080p H.264 at 4 Mbps, a 30-day month and the busiest-highway event rate above. A quieter site sends fewer events, so the edge columns shrink with traffic. The video column does not, because a camera sends the same bits over an empty road.

Data into central per day · 100 cameras

Each block is 100 GB. The video row is 43 blocks; events with photos come to under two, and metadata alone does not fill one.

Two camera settings move the video column, and neither changes the result. H.265 roughly halves the bitrate, to about 200 Mbps for 100 cameras, which is still roughly 13 times the event traffic with photos. Pulling the low-resolution sub-stream cuts it further, but discards the pixels a plate read depends on.

At that scale bandwidth is the largest running cost. A site streaming 16 Mbps around the clock moves 5.2 TB a month. That is past the 3.3 TB monthly fair-usage limit on Indian fibre broadband plans and more than 17 times the 300 GB a month on unlimited mobile plans, so every site needs a leased line, and central needs a 500 Mbps to 1 Gbps line to receive all of it. The edge design runs each site on a mobile data plan.

Cost (₹)

Pull the video

Edge: events + photo

Edge: metadata only

Site links, 25 sites

30–50 Mbps leased line at ₹12,000–22,000 each: ₹3.0–5.5 lakh a month

4G/5G plan with 300 GB at ₹449 each: ₹11,225 a month

4G/5G plan with 25–30 GB at ₹199–349 each: ₹5,000–8,700 a month

Central link

500 Mbps–1 Gbps leased line: ₹0.8–1.5 lakh a month

50 Mbps leased line: ₹13,000–22,000 a month

10 Mbps leased line: ₹6,000–12,000 a month

Links, a month

₹3.8–7.0 lakh

₹24,000–33,000

₹11,000–21,000

Links, a year

₹46–84 lakh

₹2.9–4.0 lakh

₹1.3–2.5 lakh

Compute, one time

3–4 L4-class GPUs at ₹2.3–3.6 lakh each: ₹6.9–14.5 lakh, cards only

25 Pi 5 (2 GB) with AI HAT+ 26 TOPS at ₹16,300–18,500 each: ₹4.1–4.6 lakh

The same 25 edge units: ₹4.1–4.6 lakh

First year

₹53–99 lakh

₹7.0–8.6 lakh

₹5.4–7.1 lakh

Prices are indicative 2026 figures for India, with GST and installation extra where sellers quote them separately. Both designs need a cabinet, a PoE switch and power at every site, so those are left out of both columns. The GPU count is a sizing estimate for decoding 100 1080p streams and running the highway models on them; the card price excludes the server around it, its power and its cooling.

Over a year, pulling the video spends ₹46–84 lakh on links before a single GPU is bought. The edge design spends ₹1.3–4 lakh on links and about ₹4.1–4.6 lakh once on hardware.

Why central only runs the dashboard

Bandwidth settles the argument, but it is not the only reason Ikshana puts the decision at the edge and leaves central with the dashboard.

  • An outage costs delay, not evidence. When a pulled stream drops, central has nothing to analyse until it returns, and the vehicles that passed in between are gone. An edge unit keeps deciding and recording through the outage, and its events wait in the queue for the link.
  • Local actions stay local. A siren, relay or barrier is driven by the unit wired to it. Pulled to central, every trigger waits on a WAN round trip and stops when the link does.
  • Compute grows with the sites. Each new site brings its own unit, so central does not need another GPU for another camera. Central is sized for events, not frames, and its load follows traffic rather than camera count.
  • Video stays where it was recorded. Continuous footage lives on the site’s own recorder; what leaves the site is events and short evidence clips.
  • The site’s own link is enough. A 4G SIM carries even the busiest highway unit. Pulling the video needs fibre with a guaranteed upload, which many roadside poles do not have.

The cost of this design is in the field. Pulling the video leaves nothing on site but cameras and a switch; this design puts a computer at every site, and each one needs power, an enclosure and updates. That is why the heartbeat carries each unit’s health, version and licence, and why central registers a unit from its first heartbeat: 25 units have to be as easy to run as one.

 

Pull the video to central

Decide on site, central dashboard

What leaves the site

Continuous video

Events and short evidence clips

When the link drops

No analysis until it returns

Events queue on site and arrive later

Siren or relay

Waits on a WAN round trip

Fires locally

Adding cameras

More WAN and more central GPUs

One more edge unit per four cameras

Central is sized for

Decoding and inference on every frame

Storing, searching and showing events

Site link

Fibre leased line

4G/5G SIM

Upkeep in the field

Cameras and network

Cameras, network and one edge unit per site

Fundamentals, not frameworks

None of this needed a new library. It needed the operating system and the machine used as designed.

A 2 GB board punishes every abstraction you did not understand. What it rewards is the theory from the first Pi: keep only what is necessary, and know what each remaining piece is doing for you.

One design, every scale

Device

Memory

Workload

Result

Raspberry Pi

2 GB

ANPR and ATCC with radar, sirens and relays

Whole loop on-device; 180–200 MB won back from the OS

Jetson Nano

4 GB

Incident detection: 5 applications, 4 cameras at 12 FPS

20–23 ms a frame, 41–42 FPS

Jetson Orin

8 GB

Highway enforcement: 14 applications, 6 models, 4 cameras

Plate model near 120 FPS; 75,000–80,000 events a day; 99.8% accuracy, 0.2% of vehicles missed

Raspberry Pi 5 + AI HAT

2 GB

Full highway set, 4 cameras at 15 FPS

Orin-class frame rates and inference times

Bare metal (previous tech deep-dive)

7 servers, 20 TB storage

Central Ikshana, 700+ cameras

2.5–3M events a day, zero downtime

There is research behind why the smallest board taught us the most. A review of 145 studies found that constraints help innovation right up until they become too severe. A 2 GB Pi sits just on the right side of that line, which is probably why the ideas in this post started on the Pi and moved up to the Orin, not the other way round.

The last post argued that constraints defined the architecture. This one makes the stronger claim: the architecture was right because it survived being shrunk. A design that holds at 3 million events a day on seven servers and at four cameras on 2 GB of RAM is one design, and the edge is where it was tested hardest.

Intozi builds the Ikshana Vision AI Platform, and runs it on 2 GB edge boards and bare-metal clusters alike for highways, cities, industries and enterprises. To see how the same architecture could fit your sites, explore Ikshana or talk to the Intozi team.

Authors: 

Picture of Martin Kaushal, Software Development Engineer (SDE)

Martin Kaushal, Software Development Engineer (SDE)

Picture of Sanskar Dwivedi, Senior Software Development Engineer (SDE 2)

Sanskar Dwivedi, Senior Software Development Engineer (SDE 2)

Talk to our engineering team and explore how we build

Intozi Tech Pvt Ltd

Unit no- 629, 644, 645 Tower B2, Spaze I-Tech Park, Sohna Road Sec 49, Gurgaon, Haryana-122018​

MON-FRI 09:00 - 20:00, SAT 10:00 - 14:00