{"action":"created","issue":{"url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/issues/145","repository_url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go","labels_url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/issues/145/comments","events_url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/issues/145/events","html_url":"https://github.com/yggdrasil-network/yggdrasil-go/pull/145","id":335076441,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2ODg2OTM5","number":145,"title":"More tcp fine tuning","user":{"login":"Arceliar","id":611526,"node_id":"MDQ6VXNlcjYxMTUyNg==","avatar_url":"https://avatars1.githubusercontent.com/u/611526?v=4","gravatar_id":"","url":"https://api.github.com/users/Arceliar","html_url":"https://github.com/Arceliar","followers_url":"https://api.github.com/users/Arceliar/followers","following_url":"https://api.github.com/users/Arceliar/following{/other_user}","gists_url":"https://api.github.com/users/Arceliar/gists{/gist_id}","starred_url":"https://api.github.com/users/Arceliar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arceliar/subscriptions","organizations_url":"https://api.github.com/users/Arceliar/orgs","repos_url":"https://api.github.com/users/Arceliar/repos","events_url":"https://api.github.com/users/Arceliar/events{/privacy}","received_events_url":"https://api.github.com/users/Arceliar/received_events","type":"User","site_admin":false},"labels":[{"id":855707954,"node_id":"MDU6TGFiZWw4NTU3MDc5NTQ=","url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/labels/needs%20testing","name":"needs testing","color":"6b89c4","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-23T07:12:21Z","updated_at":"2018-06-24T05:16:49Z","closed_at":"2018-06-24T05:16:49Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/pulls/145","html_url":"https://github.com/yggdrasil-network/yggdrasil-go/pull/145","diff_url":"https://github.com/yggdrasil-network/yggdrasil-go/pull/145.diff","patch_url":"https://github.com/yggdrasil-network/yggdrasil-go/pull/145.patch"},"body":"This needs further testing before merging. Some of the improvements are unexpected,\r\n\r\nDoes 2 related things:\r\n1. Moves the tcp writes to a separate goroutine from the one that manages the LIFO stack, and adjust channel buffer sizes. Using a separate goroutine for the stack manager means we can continue to read from the outgoing channel and append to the stack while a tcp write is blocked. The large buffer size of the out channel is to give the go runtime the freedom to schedule things how it wants without forcing a context switch due to the channel send.\r\n2. After a packet is added to the outgoing stack, we do a sort.SliceStable by message size. This is one of those things that I tried just for the sake of trying, but it seems to help. I think I maybe understand why: most congestion comes from TCP streams, and those tend to send many packets of the same size. The stable sort preserves the relative order of packets in a stream in that case, so the usual benefits of the LIFO order are mostly intact. However, sorting by size means that small packets are prioritized, which helps UDP traffic or TCP streams that spend most of their time idle (hopefully that includes VoIP, games, or other latency sensitive applications).\r\n\r\nTests, to be repeated when the network has other sources of congestion, in case the behavior is different for some reason (since I don't understand why it does some of what it does, it's hard to predict what the effects would be if the congestion is elsewhere):\r\n\r\nI have a connection A->B->C->...->X, where A is my computer and X is a minecraft server. While playing, I run iperf to have B send to A and congest the link (B is A's only peer). Previously, the game would stay connected, but my subjective experience was that it was unplayable under congestion--mobs warp around, punching dirt cause the block to disappear a noticeable time before the collectible/inventory dirt block spawns, and then there's another delay before it gets picked up). After these changes, there's a noticeable delay between punching a block and the item spawn, but it's not painfully obvious when I'm not trying to look for it. Mob movements aren't completely smooth, but they don't teleport around like they did before. There was one instance where a region of the map didn't seem to load properly, but I've had trouble reproducing it (it loads a little slower than I'd like in general, but I'm not sure if that's a ygg issue or normal behavior for minecraft these days--it's been a while).\r\n\r\nAnother subjective test: starting a vpn and making a test call with skype. Previously, this caused some static noises and speed warping throughout the whole call. Now it causes some noise when the TCP stream first starts in the background, and some (less severe) speed warping throughout--I might not have noticed it if I hadn't heard the same recording before.\r\n\r\nFor reasons I don't understand, throughput over iperf is more stable and a little higher on average."},"comment":{"url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/issues/comments/399730139","html_url":"https://github.com/yggdrasil-network/yggdrasil-go/pull/145#issuecomment-399730139","issue_url":"https://api.github.com/repos/yggdrasil-network/yggdrasil-go/issues/145","id":399730139,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTczMDEzOQ==","user":{"login":"Arceliar","id":611526,"node_id":"MDQ6VXNlcjYxMTUyNg==","avatar_url":"https://avatars1.githubusercontent.com/u/611526?v=4","gravatar_id":"","url":"https://api.github.com/users/Arceliar","html_url":"https://github.com/Arceliar","followers_url":"https://api.github.com/users/Arceliar/followers","following_url":"https://api.github.com/users/Arceliar/following{/other_user}","gists_url":"https://api.github.com/users/Arceliar/gists{/gist_id}","starred_url":"https://api.github.com/users/Arceliar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arceliar/subscriptions","organizations_url":"https://api.github.com/users/Arceliar/orgs","repos_url":"https://api.github.com/users/Arceliar/repos","events_url":"https://api.github.com/users/Arceliar/events{/privacy}","received_events_url":"https://api.github.com/users/Arceliar/received_events","type":"User","site_admin":false},"created_at":"2018-06-24T05:16:49Z","updated_at":"2018-06-24T05:16:49Z","author_association":"COLLABORATOR","body":"Most of this would conflict with backpressure stuff, so dropping this for now and looking at that instead."}}
{"actor":{"display_login":"Arceliar"}}