AsyncEosDevice _collect method can be optimized to send multiple commands per eAPI request
carl-baillargeon opened this issue · 0 comments
carl-baillargeon commented
Today, we send 1 command per eAPI request. We can send more commands per request, optimizing ressources on the host running ANTA and improve performance.
This is a simple script to benchmark different batch sizes, number of commands, max connections on a different number of devices.
Here are a few results using Python 3.12:
INFO:__main__:Benchmark Results:
INFO:__main__:Device: 172.20.20.101, Max Connections: 10, Number of Commands: 63
INFO:__main__: Batch size 1 took 1.984360 seconds
INFO:__main__: Batch size 20 took 0.723228 seconds
INFO:__main__: Batch size 40 took 0.860816 seconds
INFO:__main__: Batch size 60 took 1.112931 seconds
INFO:__main__: Batch size 80 took 1.116646 seconds
INFO:__main__: Batch size 100 took 1.106595 seconds
INFO:__main__: Batch size 125 took 1.067090 seconds
INFO:__main__: Batch size 150 took 1.110900 seconds
INFO:__main__: Batch size 175 took 1.092783 seconds
INFO:__main__: Batch size 200 took 1.086420 seconds
INFO:__main__: Batch size 230 took 1.093360 seconds
INFO:__main__: Batch size 260 took 1.058285 seconds
INFO:__main__: Batch size 300 took 1.085372 seconds
INFO:__main__: Batch size 350 took 1.126001 seconds
INFO:__main__: Batch size 400 took 1.074778 seconds
INFO:__main__: Batch size 500 took 1.101381 seconds
INFO:__main__: Batch size 750 took 1.091006 seconds
INFO:__main__: Batch size 1000 took 1.144774 seconds
INFO:__main__:Device: 172.20.20.101, Max Connections: 10, Number of Commands: 630
INFO:__main__: Batch size 1 took 21.030738 seconds
INFO:__main__: Batch size 20 took 6.635551 seconds
INFO:__main__: Batch size 40 took 5.775439 seconds
INFO:__main__: Batch size 60 took 6.465061 seconds
INFO:__main__: Batch size 80 took 6.223593 seconds
INFO:__main__: Batch size 100 took 6.305864 seconds
INFO:__main__: Batch size 125 took 6.145032 seconds
INFO:__main__: Batch size 150 took 6.565319 seconds
INFO:__main__: Batch size 175 took 6.766809 seconds
INFO:__main__: Batch size 200 took 5.661457 seconds
INFO:__main__: Batch size 230 took 6.607467 seconds
INFO:__main__: Batch size 260 took 6.023683 seconds
INFO:__main__: Batch size 300 took 6.062485 seconds
INFO:__main__: Batch size 350 took 7.601114 seconds
INFO:__main__: Batch size 400 took 7.281104 seconds
INFO:__main__: Batch size 500 took 9.375226 seconds
INFO:__main__: Batch size 750 took 10.650137 seconds
INFO:__main__: Batch size 1000 took 10.575484 seconds
INFO:__main__:Device: 172.20.20.101, Max Connections: 10, Number of Commands: 1260
INFO:__main__: Batch size 1 took 42.877941 seconds
INFO:__main__: Batch size 20 took 13.110887 seconds
INFO:__main__: Batch size 40 took 12.064742 seconds
INFO:__main__: Batch size 60 took 11.932345 seconds
INFO:__main__: Batch size 80 took 12.285318 seconds
INFO:__main__: Batch size 100 took 12.276008 seconds
INFO:__main__: Batch size 125 took 12.529659 seconds
INFO:__main__: Batch size 150 took 12.182494 seconds
INFO:__main__: Batch size 175 took 12.824261 seconds
INFO:__main__: Batch size 200 took 12.252677 seconds
INFO:__main__: Batch size 230 took 11.965604 seconds
INFO:__main__: Batch size 260 took 12.505216 seconds
INFO:__main__: Batch size 300 took 13.041363 seconds
INFO:__main__: Batch size 350 took 13.111065 seconds
INFO:__main__: Batch size 400 took 12.106745 seconds
INFO:__main__: Batch size 500 took 11.654323 seconds
INFO:__main__: Batch size 750 took 14.512221 seconds
INFO:__main__: Batch size 1000 took 17.639696 seconds
INFO:__main__:Device: 172.20.20.101, Max Connections: 10, Number of Commands: 1890
INFO:__main__: Batch size 1 took 67.860394 seconds
INFO:__main__: Batch size 20 took 19.143183 seconds
INFO:__main__: Batch size 40 took 18.451564 seconds
INFO:__main__: Batch size 60 took 17.700068 seconds
INFO:__main__: Batch size 80 took 18.605164 seconds
INFO:__main__: Batch size 100 took 17.941126 seconds
INFO:__main__: Batch size 125 took 17.732178 seconds
INFO:__main__: Batch size 150 took 18.418511 seconds
INFO:__main__: Batch size 175 took 17.842273 seconds
INFO:__main__: Batch size 200 took 18.563455 seconds
INFO:__main__: Batch size 230 took 17.835386 seconds
INFO:__main__: Batch size 260 took 18.949692 seconds
INFO:__main__: Batch size 300 took 17.446651 seconds
INFO:__main__: Batch size 350 took 17.778575 seconds
INFO:__main__: Batch size 400 took 18.768800 seconds
INFO:__main__: Batch size 500 took 20.302018 seconds
INFO:__main__: Batch size 750 took 17.467552 seconds
INFO:__main__: Batch size 1000 took 19.545148 seconds
INFO:__main__:Device: 172.20.20.101, Max Connections: 10, Number of Commands: 2520
INFO:__main__: Batch size 1 took 96.102869 seconds
INFO:__main__: Batch size 20 took 26.080413 seconds
INFO:__main__: Batch size 40 took 25.031001 seconds
INFO:__main__: Batch size 60 took 23.286406 seconds
INFO:__main__: Batch size 80 took 24.048434 seconds
INFO:__main__: Batch size 100 took 24.499252 seconds
INFO:__main__: Batch size 125 took 22.652488 seconds
INFO:__main__: Batch size 150 took 23.572000 seconds
INFO:__main__: Batch size 175 took 22.776834 seconds
INFO:__main__: Batch size 200 took 24.804212 seconds
INFO:__main__: Batch size 230 took 23.095126 seconds
INFO:__main__: Batch size 260 took 25.015029 seconds
INFO:__main__: Batch size 300 took 23.305336 seconds
INFO:__main__: Batch size 350 took 25.068564 seconds
INFO:__main__: Batch size 400 took 23.404142 seconds
INFO:__main__: Batch size 500 took 22.801331 seconds
INFO:__main__: Batch size 750 took 24.201554 seconds
INFO:__main__: Batch size 1000 took 22.896625 seconds
INFO:__main__:Device: 172.20.20.101, Max Connections: 10, Number of Commands: 3150
INFO:__main__: Batch size 1 took 127.689017 seconds
INFO:__main__: Batch size 20 took 32.441010 seconds
INFO:__main__: Batch size 40 took 31.607803 seconds
INFO:__main__: Batch size 60 took 30.129995 seconds
INFO:__main__: Batch size 80 took 29.578307 seconds
INFO:__main__: Batch size 100 took 29.434784 seconds
INFO:__main__: Batch size 125 took 29.096429 seconds
INFO:__main__: Batch size 150 took 28.948447 seconds
INFO:__main__: Batch size 175 took 29.458742 seconds
INFO:__main__: Batch size 200 took 29.978348 seconds
INFO:__main__: Batch size 230 took 29.788801 seconds
INFO:__main__: Batch size 260 took 28.537958 seconds
INFO:__main__: Batch size 300 took 29.982693 seconds
INFO:__main__: Batch size 350 took 28.150677 seconds
INFO:__main__: Batch size 400 took 29.731190 seconds
INFO:__main__: Batch size 500 took 29.421925 seconds
INFO:__main__: Batch size 750 took 34.303890 seconds
INFO:__main__: Batch size 1000 took 29.329047 seconds