-
Notifications
You must be signed in to change notification settings - Fork 497
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
Multithreading with concurrentqueues #162
Comments
@MvanDoorn low speed in library doesn't depends on locks. There is already exist task #110 . You can check this by increase DefaultWindowsSize to higher values.
And this will not fix problem. I am already tested this case. |
.net 4+ in Unity3d is very unstable. |
@RevenantX Thanks for your answers. TCP isn't possible in our case since it generates lots of header overhead. We need to have a latency as low as possible, preferably under 10ms. The problem whit increasing the DefaultWindowSize is, that then I don't receive any data at all anymore. Same with SocketBufferSize. I did had to set the PoolLimit to at least 5000. |
@MvanDoorn try increase DefaultWindowSize from 64 to 128, 256, 512. |
Ah i rembembered) That speed because MTU in local socket was very high (higher than 1500 bytes) |
@RevenantX I have increased the DefaultWindowSize in the steps you mentioned and also set all possible MTU's to 7981 to force it to use bigger data. Unfortunately, it all doesn't make a difference. I'm also logging the PacketsCountInReliableQueue and PacketsCountInReliableOrderedQueue. One thing I have noticed here is that with little data (under 10MB/sec orso) these numbers are both stable but when increasing the data throughput they starting to shoot to the skies. Sometime when using an avarage amount of data, it seems stable but then all of a sudden it also increases rapidly and the data stream stops. With increasing rapidly I mean the PacketCount shoots to 20.000+. Edit: this also occured when using the "default" LiteNetLib without my MTU, and DefaultWindowSize. |
@MvanDoorn this is expected behaviour. Like in TCP. But TCP will be faster for reliable ordered data anyway. |
@RevenantX TCP has to much overhead for us. We can afford to lose data, we only need it to be ordered and as fast as possible (low latency). That said, we actually need to use the "Sequenced" option of your library but that throws an exception inmediatly because the data is to big? Why doesn't sequenced allow big data? |
@MvanDoorn unreliable packets can't be higher than MTU. Because auto fragmentation disabled. You must split packets by MTU |
In our application we are trying to send massive amounts of data (+100MB/sec). With little data this library works fine but with a bigger amount of data is gets extremely slow. I pinpointed the problem and it lies with the queueing and locking system. This is the bottleneck for big data. Could you please make a branch that uses concurrentqueues with multithreading enabled? In other comments, you mentioned that Unity doesn't support it, but thats not true anymore. You can now change the .Net version of your project so we do have access to .net 4+ classes.
Your help is much appreciated.
The text was updated successfully, but these errors were encountered: