New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why do you send the same file over multiple sockets? #602
Comments
It can be faster. Try a/b testing yourself to see if it does - you can setup a croc relay with one port and then one with more than one port. I did testing back in 2019-2020 and it was faster with four ports for windows/linux machines on networks I needed to use it. |
Hmm but that makes no sense... it should be the same speed... Using 4 sockets does not mean that you send 4 packets at once... the packets are still sent on a serial manner...
|
Did you try it? |
Not yet but when we talk theoretically this should not improve performance... also if it would platforms like Netflix would've done that (Btw side note just because we are talking, I implemented pake/siec in rust if you want to see) |
Yeah would love to see a SIEC implementation! Is it public? The benefits might be OS specific, but they were beneficial with my testing between Windows and Linux. Maybe it's different now, it deserves testing. |
Just dropping into the conversation as I stumbled upon here randomly while scrolling through the issues. Not a contributor of this repo but I just wanted to add my 2 cents on the networking side of things.
|
|
Hmm I didnt read the whole thing because its 2AM, but as for point 1 and 2, its not true.
Also on most OS's you can change the window size using
is a good point, but I havn't seen a dropped packet since like 5 months ago...
I dont use satalite I have fiber optics but I still dont understand why it matters as long as you can really send in parallel on a physical link
I bet you that I can make a single threaded |
That’s great, but did you test it? It looks like you can disable the parallel transmission with the option --no-multi. I used a 670 MB file, macOS on both ends, 100 Mbit/s downstream DSL on the receiving end, multiple runs. With defaults, multiplexing enabled, it took an average of 78 seconds. Without multiplexing, it took 92 seconds. Seems worthwhile to me. |
I understand that it's faster rn... My feeling is that it's faster not because the multiplexing but because of the design or some other scheduling reasons (maybe try benchmarking on a single core with Anyways I'm planning on investing that anyway... Did you make the time benchmarking start right when the file transmission start? In general just because something works faster doesn't mean it's the solution to that problem |
Sure! I did
on the receiving end each time, and alternated sending the same file with and without --no-multi. Here are the times in seconds.
Why not run some tests yourself? And I’m sure if you can build something that’s consistently faster than the current code, people will be interested to see your test results. |
I don't have a lot of time (: + I believe you when you say it's faster... but the math isn't mathing for me 😊 |
Hey so I think the decryption part in receiveData is the bottle neck, if you'd send the data received to a different decryption thread and keep reading packets it might be faster in a single threaded environment then on multithreaded one |
It’s great that you want to speed up croc, but a concrete implementation might be more helpful than unproven hypotheses. You can disable compression with --no-compress. I ran another quick test, different file and different endpoint, so not directly comparable to the last. Compression disabled |
Thanks so much @ferebee for running some experiments! A 16% improvement seems pretty good. Also thanks @shidenkai0 for weighing in with a very detailed overview!! That is greatly appreciated. @AsafFisher I went ahead and tested your hypothesis about decryption with and without multiplexing. I removed encryption and tried sending files. Without encryption, with multiplexing: 105 seconds. Without encryption, without multiplexing: 115 seconds. Not a 16% improvement like @ferebee, but an improvement nonetheless with multiplexing and without encryption. @AsafFisher now its your turn! Please try running your own tests, see for yourself. |
Oh my, there I was looking at compression while @AsafFisher was talking about encryption. Good to see the results hold up anyway. I’ll mention that in the ’90s we were developing some custom software to send 3D rendering jobs over multiple ISDN lines in parallel. We had several well-reasoned theories about how the Linux TCP/IP stack would behave, and they were all wrong. We ended up multiplexing. |
I'll do my tests sometime, anyways if it's possible to do a decryption thread and make the file transfer even faster so that's a good outcome (: |
its been four months @AsafFisher, what were the results of your tests? |
What is the file size you used? |
don't remember |
On my rust client, using your relay at |
you need to test croc between the same two computers against your result. otherwise it is not controlled against all the network infrastructure |
@AsafFisher its been a bit. have you been able to run tests comparing multiplexing and not multiplexing on the same system? |
Describe the bug
I do not understand why you use multiple sockets to transfare files... It seems to me like one socket for data transfare would be enough
The text was updated successfully, but these errors were encountered: