anycable / websocket-bench

CLI interface for benchmark AnyCable
10 stars 2 forks source link

Crash on a max of 30,000 connections #3

Open cayolblake opened 2 years ago

cayolblake commented 2 years ago
$ websocket-bench echo -c 50000 --limit-rtt 15ms ws://0.0.0.0:2346
3100 / 5000 [--------------------------------------------------------------------------------------------------------->________________________________________________________________] 62.00%5000 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s20 / 20 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 27 p/s[2022-03-11T01:49:15Z] clients:  5000    95per-rtt:  11ms    min-rtt:  10ms    median-rtt:  11ms    max-rtt:  11ms
3600 / 5000 [-------------------------------------------------------------------------------------------------------------------------->_______________________________________________] 72.00%5000 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s20 / 20 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 28 p/s[2022-03-11T01:49:17Z] clients: 10000    95per-rtt:  12ms    min-rtt:  11ms    median-rtt:  11ms    max-rtt:  12ms
1295 / 5000 [-------------------------------------------->_____________________________________________________________________________________________________________________________] 25.90%3403 / 5000 [------------------------------------------------------------------------------------------------------------------->______________________________________________________] 68.06%4300 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------->_______________________] 86.00%4500 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------->_________________] 90.00%4603 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------>_____________] 92.06%4801 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------------->______] 96.02%5000 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s20 / 20 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 26 p/s[2022-03-11T01:49:19Z] clients: 15000    95per-rtt:  12ms    min-rtt:  12ms    median-rtt:  12ms    max-rtt:  12ms
7 / 5000 [>_____________________________________________________________________________________________________________________________________________________________________________] 0.14%200 / 5000 [------>_____________________________________________________________________________________________________________________________________________________________________] 4.00%425 / 5000 [-------------->_____________________________________________________________________________________________________________________________________________________________] 8.50%665 / 5000 [---------------------->____________________________________________________________________________________________________________________________________________________] 13.30%800 / 5000 [--------------------------->_______________________________________________________________________________________________________________________________________________] 16.00%1000 / 5000 [--------------------------------->________________________________________________________________________________________________________________________________________] 20.00%1200 / 5000 [---------------------------------------->_________________________________________________________________________________________________________________________________] 24.00%1400 / 5000 [----------------------------------------------->__________________________________________________________________________________________________________________________] 28.00%1515 / 5000 [--------------------------------------------------->______________________________________________________________________________________________________________________] 30.30%1796 / 5000 [------------------------------------------------------------->____________________________________________________________________________________________________________] 35.92%1967 / 5000 [------------------------------------------------------------------>_______________________________________________________________________________________________________] 39.34%2100 / 5000 [----------------------------------------------------------------------->__________________________________________________________________________________________________] 42.00%2317 / 5000 [------------------------------------------------------------------------------>___________________________________________________________________________________________] 46.34%2506 / 5000 [------------------------------------------------------------------------------------->____________________________________________________________________________________] 50.12%2600 / 5000 [---------------------------------------------------------------------------------------->_________________________________________________________________________________] 52.00%2800 / 5000 [----------------------------------------------------------------------------------------------->__________________________________________________________________________] 56.00%3001 / 5000 [------------------------------------------------------------------------------------------------------>___________________________________________________________________] 60.02%3200 / 5000 [------------------------------------------------------------------------------------------------------------>_____________________________________________________________] 64.00%3382 / 5000 [------------------------------------------------------------------------------------------------------------------>_______________________________________________________] 67.64%3502 / 5000 [----------------------------------------------------------------------------------------------------------------------->__________________________________________________] 70.04%3779 / 5000 [-------------------------------------------------------------------------------------------------------------------------------->_________________________________________] 75.58%3922 / 5000 [------------------------------------------------------------------------------------------------------------------------------------->____________________________________] 78.44%4100 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------->______________________________] 82.00%4201 / 5000 [---------------------------------------------------------------------------------------------------------------------------------------------->___________________________] 84.02%4400 / 5000 [----------------------------------------------------------------------------------------------------------------------------------------------------->____________________] 88.00%4601 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------>_____________] 92.02%4800 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------------->______] 96.00%4925 / 5000 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------->__] 98.50%5000 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s20 / 20 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 28 p/s[2022-03-11T01:49:25Z] clients: 20000    95per-rtt:  13ms    min-rtt:  12ms    median-rtt:  13ms    max-rtt:  13ms
100 / 5000 [--->________________________________________________________________________________________________________________________________________________________________________] 2.00%300 / 5000 [---------->_________________________________________________________________________________________________________________________________________________________________] 6.00%501 / 5000 [----------------->_________________________________________________________________________________________________________________________________________________________] 10.02%602 / 5000 [-------------------->______________________________________________________________________________________________________________________________________________________] 12.04%800 / 5000 [--------------------------->_______________________________________________________________________________________________________________________________________________] 16.00%994 / 5000 [--------------------------------->_________________________________________________________________________________________________________________________________________] 19.88%1200 / 5000 [---------------------------------------->_________________________________________________________________________________________________________________________________] 24.00%1301 / 5000 [-------------------------------------------->_____________________________________________________________________________________________________________________________] 26.02%1520 / 5000 [--------------------------------------------------->______________________________________________________________________________________________________________________] 30.40%1602 / 5000 [------------------------------------------------------>___________________________________________________________________________________________________________________] 32.04%1800 / 5000 [------------------------------------------------------------->____________________________________________________________________________________________________________] 36.00%2044 / 5000 [--------------------------------------------------------------------->____________________________________________________________________________________________________] 40.88%2200 / 5000 [-------------------------------------------------------------------------->_______________________________________________________________________________________________] 44.00%2301 / 5000 [------------------------------------------------------------------------------>___________________________________________________________________________________________] 46.02%2500 / 5000 [------------------------------------------------------------------------------------>_____________________________________________________________________________________] 50.00%2700 / 5000 [------------------------------------------------------------------------------------------->______________________________________________________________________________] 54.00%2801 / 5000 [----------------------------------------------------------------------------------------------->__________________________________________________________________________] 56.02%3000 / 5000 [----------------------------------------------------------------------------------------------------->____________________________________________________________________] 60.00%3185 / 5000 [------------------------------------------------------------------------------------------------------------>_____________________________________________________________] 63.70%3300 / 5000 [---------------------------------------------------------------------------------------------------------------->_________________________________________________________] 66.00%3512 / 5000 [----------------------------------------------------------------------------------------------------------------------->__________________________________________________] 70.24%3700 / 5000 [----------------------------------------------------------------------------------------------------------------------------->____________________________________________] 74.00%3800 / 5000 [--------------------------------------------------------------------------------------------------------------------------------->________________________________________] 76.00%3902 / 5000 [------------------------------------------------------------------------------------------------------------------------------------>_____________________________________] 78.04%4100 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------->______________________________] 82.00%4311 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------->_______________________] 86.22%4500 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------->_________________] 90.00%4601 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------>_____________] 92.02%4800 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------------->______] 96.00%4967 / 5000 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------>_] 99.34%5000 / 5000 [-------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s0 / 20 [__________________________________________________________________________________________________________________________________________________________________________] 0.00% ? p/s20 / 20 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 33 p/s[2022-03-11T01:49:32Z] clients: 25000    95per-rtt:  13ms    min-rtt:  13ms    median-rtt:  13ms    max-rtt:  13ms
0 / 5000 [______________________________________________________________________________________________________________________________________________________________________________] 0.00%200 / 5000 [------>_____________________________________________________________________________________________________________________________________________________________________] 4.00%315 / 5000 [---------->_________________________________________________________________________________________________________________________________________________________________] 6.30%504 / 5000 [----------------->_________________________________________________________________________________________________________________________________________________________] 10.08%700 / 5000 [----------------------->___________________________________________________________________________________________________________________________________________________] 14.00%800 / 5000 [--------------------------->_______________________________________________________________________________________________________________________________________________] 16.00%982 / 5000 [--------------------------------->_________________________________________________________________________________________________________________________________________] 19.64%1100 / 5000 [------------------------------------->____________________________________________________________________________________________________________________________________] 22.00%1200 / 5000 [---------------------------------------->_________________________________________________________________________________________________________________________________] 24.00%1478 / 5000 [-------------------------------------------------->_______________________________________________________________________________________________________________________] 29.56%1600 / 5000 [------------------------------------------------------>___________________________________________________________________________________________________________________] 32.00%1701 / 5000 [--------------------------------------------------------->________________________________________________________________________________________________________________] 34.02%1900 / 5000 [---------------------------------------------------------------->_________________________________________________________________________________________________________] 38.00%2000 / 5000 [------------------------------------------------------------------->______________________________________________________________________________________________________] 40.00%2101 / 5000 [----------------------------------------------------------------------->__________________________________________________________________________________________________] 42.02%2310 / 5000 [------------------------------------------------------------------------------>___________________________________________________________________________________________] 46.20%2500 / 5000 [------------------------------------------------------------------------------------>_____________________________________________________________________________________] 50.00%2606 / 5000 [---------------------------------------------------------------------------------------->_________________________________________________________________________________] 52.12%2701 / 5000 [------------------------------------------------------------------------------------------->______________________________________________________________________________] 54.02%2900 / 5000 [-------------------------------------------------------------------------------------------------->_______________________________________________________________________] 58.00%3000 / 5000 [----------------------------------------------------------------------------------------------------->____________________________________________________________________] 60.00%panic: dial tcp 0.0.0.0:2346: connect: cannot assign requested address

goroutine 56450 [running]:
github.com/anycable/websocket-bench/benchmark.newLocalClient(0x0, 0x7ffe7dc802d4, 0x11, 0x81b205, 0x10, 0x8176b9, 0x4, 0xc000074120, 0xc0000740c0, 0xacaba8, ...)
    ~/websocket-bench/benchmark/local_client.go:96 +0xadc
github.com/anycable/websocket-bench/benchmark.(*LocalClientPool).New(0xc00000e180, 0x61a8, 0x7ffe7dc802d4, 0x11, 0x81b205, 0x10, 0x8176b9, 0x4, 0xc000074120, 0xc0000740c0, ...)
    ~/websocket-bench/benchmark/local_client.go:222 +0xd2
github.com/anycable/websocket-bench/benchmark.(*Benchmark).startClients.func1(0xc000120a20, 0xc01d5e8268, 0x61a8, 0xc01d5e8260, 0xc0001561c0, 0xc01d5e8250)
    ~/websocket-bench/benchmark/benchmark.go:201 +0xfb
created by github.com/anycable/websocket-bench/benchmark.(*Benchmark).startClients
    ~/websocket-bench/benchmark/benchmark.go:199 +0xeb
cayolblake commented 2 years ago

What am I doing wrong? 🤔

palkan commented 2 years ago

panic: dial tcp 0.0.0.0:2346: connect: cannot assign requested address

One of the reasons is that you hit the limit on the number of outgoing open ports / sockets; see, for example, https://github.com/golang/go/issues/16012