We will use caproto-shark to analyze CA network traffic. Note that the actual servers and clients involve may or may not be using caproto themselves; it does not matter.
-
Install caproto and pandas if they are not already installed.
pip install caproto[standard] pandas
-
Start
tcpdump
to capture network traffic and write it to a file.sudo tcpdump -i <INTERFACE> -w some_network_traffic.pcap
Use
ifconfig
to list the available interfaces. For example, if the servers in question are running on the localhost:sudo tcpdump -i lo -w some_network_traffic.pcap
-
Run some EPICS client code that will create CA connections with servers (e.g. run
bsui
). -
Stop
tcpdump
with Ctrl+C. -
Analyze the results using the script in this gist.
python benchmark.py some_network_traffic.pcap
Example output:
0 channel creation requests were unanswered during this capture.
Raw data:
PV server_address t dt
0 simple:A 192.168.86.22 1.614185e+09 0.014851
1 simple:B 192.168.86.22 1.614185e+09 0.014851
2 simple:C 192.168.86.22 1.614185e+09 0.014851
3 rpi:color 192.168.86.245 1.614185e+09 0.150308
Aggregated stats by server address:
count mean std min 25% 50% 75% max
server_address
192.168.86.22 3.0 0.014851 0.0 0.014851 0.014851 0.014851 0.014851 0.014851
192.168.86.245 1.0 0.150308 NaN 0.150308 0.150308 0.150308 0.150308 0.150308