High latency and jitter when using rathole for a Minecraft Java edition server
Describe the bug
I am using this absolutely incredible peice of software (rathole) - really I am amazed by how simple and effective it is.
I have a single issue with it. Latency and jitter. When I am using haproxy, I get 10-15 max ping, very stable. When using rathole, the ping is allover the place, from 4 to 88, even with nodelay enabled. I now use haproxy mid-way in order to keep player's IP with Proxy protocol, but ignore that, it works just as jittery without haproxy at all, tested it many times already. I should mention that the ping nor the jitter is immediately noticeable (it is not bad at all, just nowhere near perfection, like haproxy). To Reproduce Steps to reproduce the behavior:
- use rathole to reverse proxy a minecraft java edition server (TCP)
Configuration Configuration used to reproduce the behavior:
server.toml
[server]
bind_addr = "0.0.0.0:2333" # 2333 specifies the port that rathole listens for clients
default_token = "SOMEPASS"
[server.transport] type = "tcp"
[server.transport.tcp] nodelay = true
[server.services.http] bind_addr = "0.0.0.0:80" type = "tcp"
[server.services.https] bind_addr = "0.0.0.0:443" type = "tcp"
[server.services.javatcn] bind_addr = "0.0.0.0:25566" type = "tcp" nodelay = true
[server.services.ademc] bind_addr = "0.0.0.0:1400" type = "tcp"
[server.services.bedrocktcn] bind_addr = "0.0.0.0:19132" type = "udp" Logs
CLIENT LOGS
root@serverhp:~/rathole# ./rathole client.toml Jul 28 03:48:35.578 INFO handle{service=bedrocktcn}: rathole::client: Starting 643aad576114f32b98d1673947d21e6a142e9685c1ff456b8e93831ca9c1fc0e Jul 28 03:48:35.578 INFO handle{service=javatcn}: rathole::client: Starting 6c138220128ab0992cab4654559c576b918012089529c6cab4af7bdb1fdbf5fd Jul 28 03:48:35.578 INFO handle{service=https}: rathole::client: Starting 3e1943522517e81328e3f3f7ea1f0d7fc2ca886dfe1639a7fa6508760d1cee3a Jul 28 03:48:35.578 INFO handle{service=http}: rathole::client: Starting e0603c499aae47eb89343ad0ef3178e044c62e70ae2309b35591d1d49a3211ec Jul 28 03:48:35.578 INFO handle{service=ademc}: rathole::client: Starting 0ad444b5d6a849be50583984d773445ea97bd0537137e2575c22388b08e05b01 Jul 28 03:48:35.578 INFO config_watcher{path="client.toml"}: rathole::config_watcher: Start watching the config Jul 28 03:48:35.584 INFO handle{service=https}:run: rathole::client: Control channel established Jul 28 03:48:35.610 INFO handle{service=ademc}:run: rathole::client: Control channel established Jul 28 03:48:35.615 INFO handle{service=javatcn}:run: rathole::client: Control channel established Jul 28 03:48:35.615 INFO handle{service=bedrocktcn}:run: rathole::client: Control channel established Jul 28 03:48:35.618 INFO handle{service=http}:run: rathole::client: Control channel established
SERVER LOGS
root@vps95107:~/rathole# ./rathole server.toml Jul 28 00:48:31.869 INFO config_watcher{path="server.toml"}: rathole::config_watcher: Start watching the config Jul 28 00:48:31.869 INFO rathole::server: Listening at 0.0.0.0:2333 Jul 28 00:48:35.692 INFO connection{addr=PERSONAL_IP:55612}: rathole::server: Try to handshake a control channel Jul 28 00:48:35.694 INFO connection{addr=PERSONAL_IP:55612}: rathole::server: Control channel established service=https Jul 28 00:48:35.694 INFO connection{addr=PERSONAL_IP:55612}:handle{service=https}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:443 Jul 28 00:48:35.710 INFO connection{addr=PERSONAL_IP:53645}: rathole::server: Try to handshake a control channel Jul 28 00:48:35.713 INFO connection{addr=PERSONAL_IP:57378}: rathole::server: Try to handshake a control channel Jul 28 00:48:35.713 INFO connection{addr=PERSONAL_IP:51862}: rathole::server: Try to handshake a control channel Jul 28 00:48:35.715 INFO connection{addr=PERSONAL_IP:23872}: rathole::server: Try to handshake a control channel Jul 28 00:48:35.721 INFO connection{addr=PERSONAL_IP:53645}: rathole::server: Control channel established service=ademc Jul 28 00:48:35.721 INFO connection{addr=PERSONAL_IP:53645}:handle{service=ademc}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:1400 Jul 28 00:48:35.726 INFO connection{addr=PERSONAL_IP:57378}: rathole::server: Control channel established service=javatcn Jul 28 00:48:35.726 INFO connection{addr=PERSONAL_IP:57378}:handle{service=javatcn}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:25566 Jul 28 00:48:35.726 INFO connection{addr=PERSONAL_IP:51862}: rathole::server: Control channel established service=bedrocktcn Jul 28 00:48:35.726 INFO connection{addr=PERSONAL_IP:51862}:handle{service=bedrocktcn}:run_udp_connection_pool: rathole::server: Listening at 0.0.0.0:19132 Jul 28 00:48:35.728 INFO connection{addr=PERSONAL_IP:23872}: rathole::server: Control channel established service=http Jul 28 00:48:35.728 INFO connection{addr=PERSONAL_IP:23872}:handle{service=http}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:80
Environment:
- OS: Ubuntu 18.04.6 for the Public IP server Ubuntu 20.04 for the behind CGNAT, dynamic IP server
rathole --versionoutput:root@serverhp:~/rathole# ./rathole --version rathole Build Timestamp: 2022-05-23T12:35:49.532232791+00:00 Build Version: 0.4.2 Commit SHA: Some("ee39a8e31e3fe26e58c01ecdfaa646b187f25b79") Commit Date: Some("2022-05-23T12:31:03+00:00") Commit Branch: Some("detached HEAD") cargo Target Triple: x86_64-unknown-linux-gnu cargo Profile: release cargo Features: base64,client,default,hot_reload,noise,notify,server,snowstorm,tls,tokio_native_tls- CPU architecture: x86_64
Source: rathole-org/rathole