shred-stats is a benchmark tool used to compare solana shred streams from different sources. It will collect shred in one minute and compare target
shred stream against base shred stream.
You can run this benchmark tool with this command;
./shred-stats --target-port 19001 --port 19002
this command will use shred receive from port 19001 as benchmark target and shred receive from port 19002 as benchmark base.
It will show shred receive pecentage and compare target shred receive time against base shred receive time, and show lead time quantiles(only shred that target receive earlier than base) and diff time quantiles(all shred receive time diff).
the output will look like this:
listen on fd port 19002
listen on fd port 19001
running benchmark test for a minute
First seen shred in 1min: {From:targets, Nums:116395, Percent:84.7%}, {From:others, Nums:0, Percent:0.0%}, {From:19002, Nums:21014, Percent:15.3%}
Target-led shred lead time (n=116395) against 19002: P1=22.9412ms, P5=14.105856ms, P10=10.850245ms, P25=7.986863ms, P50=4.010252ms, P75=1.819601ms, P80=1.47715ms, P90=779.731µs, P95=407.271µs, P99=86.09µs
Target-diff shred diff time (n=137384) against 19002: P1=22.07678ms, P5=13.068596ms, P10=10.348995ms, P25=7.330483ms, P50=3.059971ms, P75=884.73µs, P80=448.9µs, P90=-562.98µs, P95=-1.301121ms, P99=-2.586531ms
You can assign multiple ports as benchmark base by simply add more --port port-number parameter
For more advanced usage, please see Advacned Usage
Prerequisties:
Go version >= 1.24.1
Build command:
go build
Build release:
go build -ldflags="-s -w"
you will get exec file shred-stats
clean command:
go clean
User should receive different solana shred streams on different ports, or receive from different source ips to same port on host machine, otherwise this tool will not be able to differentiate them.
-
Listening ports
The
--portparameter needs to provide a port to receive udp solana shred stream, make sure that no other program is listening on these ports. You can listen multiple ports by set this parameter multiple times:--port 8001 --port 8002 (program will listen both port 8001 and 8002)if no other parameter is provided, shred recevie on first port will be target, and shred receive on other ports will be benchmark bases
-
Enable ip filter
You can set the "--is-filter-addr" parameter, to enable benchmark to filter ip, this required to use
--target-ip-filtersand--base-ip-filters -
Target ip filter
The
--target-ip-filtersparameter needs to provide benchmark target solana stream src ip and the dst port the stream sent to, the formats is{shredSrcIp}-{dstPort}you can assign multiple target-ip-filters separated by "," :
--target-src-ips 2.2.2.2-8001, 3.3.3.3-8002this means program will treat solana shred packets received on port 8001 from 2.2.2.2 and packets received on port 8002 from 3.3.3.3 both as packets received from target and combine the stats
-
Base src ips
The
--base-ip-filtersparameter needs to provide benchmark base name, src ip and the dst port the stream sent to, the parameter format is{baseName}:{ShredSrcIp}-{dstPort}you can assign multiple base-ip-filters separated by "," :
--base-ip-filters jito:1.1.1.1-8000, bloxroute:2.2.2.2-8001This parameter value means program will treat shred packets received on port 8000 from 1.1.1.1 as benchmark base named "jito", shred packet receive on port 8001 from 2.2.2.2 as benchmark base named "bloxroute"
Here is an example of how to run shred-stats:
with addr filter
./shred-stats --port 19001 --port 19002 --is-filter-addr --target-ip-filters 1.1.1.1-19001 --base-ip-filters jito:127.0.0.1-19002
this means shred-stats will receive shred packets on port 19001 and 19002, and benchmark target will be shred packets received on port 19001 from 1.1.1.1, benchmark base "jito" will be shred packets received on port 19000 from 127.0.0.1. The benchmark will compare target against both base jito and all other shreds.
this program will provide benchmark results both in "traffic_stats.log" file and as prometheus metrics at "{metrics-addr}/metrics". The result will be shreds receive count and receive time comparison in a minute.
Here is an example of a benchmark test result :
time="2025-08-13T08:18:40.458525" level=info msg="Total seen shred in 1min: {From:targets, Nums:241502}, {From:others, Nums:303406}"
time="2025-08-13T08:18:49.091981" level=info msg="First seen shred in 1min: {From:targets, Nums:105849, Percent:85.9%}, {From:others, Nums:0, Percent:0.0%}, {From:jito, Nums:17344, Percent:14.1%}"
time="2025-08-13T08:18:49.102957" level=info msg="Target-led shred lead time (n=105849) against jito: P1=40.879251ms, P5=14.565807ms, P10=9.953365ms, P25=6.504893ms, P50=3.050502ms, P75=1.465971ms, P80=1.207081ms, P90=656.77µs, P95=349.21µs, P99=73.44µs"
time="2025-08-13T08:18:49.116058" level=info msg="Target-diff shred diff time (n=123161) against jito: P1=40.23823ms, P5=13.339456ms, P10=9.295675ms, P25=5.806763ms, P50=2.428691ms, P75=810.02µs, P80=470.5µs, P90=-347.39µs, P95=-937.191µs, P99=-2.132071ms"
- The first line shows total shreds received by target and others.
- The second line shows that how many shreds are first been by target, base "jito" or other srcs.
- The third line shows the quantiles of target shred receive time's lead against base "jito"'s. This excludes shreds that base receive earlier than target
- The fourth line shows the quantiles of the time diiference between a shred received by target and received by base "jito". Negative time means base receive earlier than target
The default metrics endpoint is ":2112", you can also change it using parameter --metrics-addr. Here is an example of benchmark test result from metrics enpoint:
# HELP shred_stream_first_shred shred first seen in the last minute
# TYPE shred_stream_first_shred gauge
shred_stream_first_shred{src="jito"} 19040
shred_stream_first_shred{src="other"} 0
shred_stream_first_shred{src="relay"} 106510
# HELP shred_stream_shred_diff_quantile shred diff in microseconds in last minute
# TYPE shred_stream_shred_diff_quantile gauge
shred_stream_shred_diff_quantile{base="jito",quantile="0.01"} 21804
shred_stream_shred_diff_quantile{base="jito",quantile="0.05"} 12080
shred_stream_shred_diff_quantile{base="jito",quantile="0.10"} 9008
shred_stream_shred_diff_quantile{base="jito",quantile="0.25"} 5344
shred_stream_shred_diff_quantile{base="jito",quantile="0.50"} 2304
shred_stream_shred_diff_quantile{base="jito",quantile="0.75"} 696
shred_stream_shred_diff_quantile{base="jito",quantile="0.80"} 343
shred_stream_shred_diff_quantile{base="jito",quantile="0.90"} -405
shred_stream_shred_diff_quantile{base="jito",quantile="0.95"} -917
shred_stream_shred_diff_quantile{base="jito",quantile="0.99"} -2000
# HELP shred_stream_shred_lead_quantile shred lead in microseconds in last minute
# TYPE shred_stream_shred_lead_quantile gauge
shred_stream_shred_lead_quantile{base="jito",quantile="0.01"} 22665
shred_stream_shred_lead_quantile{base="jito",quantile="0.05"} 12978
shred_stream_shred_lead_quantile{base="jito",quantile="0.10"} 9627
shred_stream_shred_lead_quantile{base="jito",quantile="0.25"} 6171
shred_stream_shred_lead_quantile{base="jito",quantile="0.50"} 2915
shred_stream_shred_lead_quantile{base="jito",quantile="0.75"} 1402
shred_stream_shred_lead_quantile{base="jito",quantile="0.80"} 1151
shred_stream_shred_lead_quantile{base="jito",quantile="0.90"} 596
shred_stream_shred_lead_quantile{base="jito",quantile="0.95"} 299
shred_stream_shred_lead_quantile{base="jito",quantile="0.99"} 59
You can use grafana to visualize this result
Below, we list all the available paramters ued when running this benchmark. You can also use the flag --help for more detailed infos.
--log-level value Stdout log level (default: "info")
--log-file-level value Logfile log level (default: "info")
--log-max-size value Max logfile size MB (default: 100)
--log-max-backups value Max logfile backups (default: 10)
--log-max-age value Logfile max age (default: 10)
--port value Inbound network ports
--target-ip-filters value filter Target shred by ips recv from certain port(e.g. 1.1.1.1-8000,2.2.2.2-8001)
--base-ip-filters value filter base shred by ips from certain port and name the base(e.g. jito:1.1.1.1-8000, bloxroute:2.2.2.2-8001)
--metrics-addr value metric server addr(e.g. :2112) (default: ":2112")
--is-filter-addr if filter shred src addr
--help, -h show help