Solana decoder CPU cost is set by your own traffic and code, so no published figure will fit your server. Measure it instead: replay recorded packets through each stage, time recovery, entry parsing, transaction parsing, lookup resolution, program decoding and writes separately, then size cores for the busiest slots you recorded, with headroom on top.
Where the work goes, stage by stage#
A decoder is a chain of stages, and each has its own cost profile:
- Receive: reading datagrams from the socket. Mostly system call and copy work, proportional to packet count.
- Recovery: rebuilding missing data shreds from coding shreds. Only runs when packets were lost, so its cost rises exactly when your network is having a bad moment.
- Entry parsing: joining data shred payloads in order and reading entries out of them.
- Transaction parsing: splitting entries into transactions and reading headers, keys and instructions.
- Lookup resolution: turning v0 table indexes into addresses, cheap from a warm cache and slow when a table must be fetched.
- Program decoding: reading instruction data for the programs you care about.
- Writes: serialising rows and sending them to a queue or database.
Which stage dominates depends on what you keep. A pipeline that decodes every instruction of every program spends its time in the later stages. One that keeps a handful of programs spends it near the front.
Measuring each stage on your own traffic#
- Record real traffic to a capture file for a period that includes quiet and busy slots. Replaying a file makes every test run see the same input.
- Add a timer around each stage and export it as a histogram per stage, not one total. A total hides which stage grew.
- Replay the capture at its original pace first, and check that no stage falls behind. Then replay it as fast as the decoder will take it; the rate where a stage saturates one core is its ceiling.
- Profile the slowest stage with a sampling profiler such as perf, so you fix the function that costs most instead of the one you suspect.
- Benchmark tight inner functions, such as a transaction parser, with a statistics aware benchmark tool such as criterion, so small changes are not lost in noise.
- Repeat after each change to filters, language or data structures, and keep the results next to the commit that produced them.
What moves the bill: filters, language, allocation#
Where you filter. Dropping irrelevant transactions early is the largest saving available, because every later stage then sees less. Where to filter in a pipeline weighs the trade: the earlier the filter, the more it can miss.
Allocation. A parser that copies every key and instruction into fresh memory spends a surprising share of its time in the allocator. Borrowing views over the packet buffer avoids that; zero copy parsing shows how in Rust.
Language and layout. The language matters less than how stages are arranged. A comparison of decoder languages goes stage by stage, and decoder placement covers running decoding inside the bot or as its own service.
Lookup tables. A cold cache turns a cheap stage into network calls. Warm it before measuring, then measure a cold start separately.
Sizing for busy slots, not average ones#
Averages flatter a decoder. The slots that matter, such as a popular token launch or a liquidation wave, carry far more transactions than a quiet one, and a decoder that keeps up on average will queue and fall behind exactly then. Raw UDP does not wait for you: if the receive stage cannot drain the socket, packets are dropped and gone.
So size from the high percentiles of your recorded per slot work, not the mean. Keep the receive stage on its own core, so a slow decoder backs up into its queue instead of into the socket buffer. Then leave spare capacity, because the next busy period may be busier than the one you recorded.
A sizing worksheet to fill in#
| Stage | Time per slot, typical (yours) | Time per slot, busiest recorded (yours) | Share of one core at the busiest (yours) | Notes |
|---|---|---|---|---|
| Receive | Own core recommended | |||
| Recovery | Rises with packet loss | |||
| Entry parsing | ||||
| Transaction parsing | ||||
| Lookup resolution | Warm and cold cache | |||
| Program decoding | Depends on programs kept | |||
| Writes | Depends on batch size | |||
| Total with headroom |
The blanks are deliberate. Fill them from your own replays; the decoding pipeline describes each stage you are timing, and observability for decoders turns the same timers into production metrics.
What this method will not tell you#
A capture shows the traffic of the day you recorded it. Network upgrades, new programs and changes in market activity shift the mix, so re-run the measurement after big changes. Replays also skip the network itself: they test the decoder, not whether the receiving server drops packets under load. Check socket drop counters on the live machine for that.
Related reading#
Compiled instructions explains the format the parsing stage reads. When you are ready to record your own traffic, see the plans and prices.
Sources#
- Linux perf wiki (sampling profiler for per function cost) (checked 2026-11-18)
- criterion.rs documentation (statistical benchmarks for Rust stages) (checked 2026-11-18)
- Prometheus docs: histograms and summaries (checked 2026-11-18)
- Agave v4.4.1 ledger shred module (FEC sets, data and coding shreds) (checked 2026-11-18)
- Agave v4.4.1 entry struct (checked 2026-11-18)
Raw shreds on your own server
Ultra Low Latency Shreds is $200 and Standard Shreds is $100. You pay in crypto, tell us which IPv4 address and UDP port should receive the stream, and we wire it up by hand.