Skip to content
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

perf(jetsocat): use a larger buffer for plain forwarding #968

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

CBenoit
Copy link
Member

@CBenoit CBenoit commented Aug 12, 2024

By increasing the size of the intermediate buffer from 8k to 16k, perfomance of raw TCP forwarding is increased by ~19.4%.

Performance was measured using iperf on local network.

Direct:

0.0000-10.0091 sec 120 GBytes 103 Gbits/sec

Forwarding using socat:

0.0000-10.0155 sec 39.5 GBytes 33.9 Gbits/sec

Forwarding using jetsocat without this patch:

0.0000-10.0016 sec 52.1 GBytes 44.7 Gbits/sec

~31.8% faster than socat.

Forwarding using jetsocat with this patch:

0.0000-10.0076 sec 62.2 GBytes 53.4 Gbits/sec

~57.5% faster than socat and ~19.4% faster than without this patch.

Forwarding using jetsocat’s JMUX proxy (unrelated to this patch):

0.0000-10.0519 sec 8.27 GBytes 7.07 Gbits/sec

Using the JMUX proxy, even for a simple TCP port forwarding, is currently a whole ~86.7 slower than regular TCP port forwarding.

By increasing the size of the intermediate buffer from 8k to 16k,
perfomance of raw TCP forwarding is increased by ~19.4%.

Performance was measured using `iperf` on local network.

Direct:

> 0.0000-10.0091 sec   120 GBytes   103 Gbits/sec

Forwarding using `socat`:

> 0.0000-10.0155 sec  39.5 GBytes  33.9 Gbits/sec

Forwarding using `jetsocat` without this patch:

> 0.0000-10.0016 sec  52.1 GBytes  44.7 Gbits/sec

~31.8% faster than `socat`.

Forwarding using `jetsocat` with this patch:

> 0.0000-10.0076 sec  62.2 GBytes  53.4 Gbits/sec

~57.5% faster than `socat` and ~19.4% faster than without this patch.

Forwarding using `jetsocat`’s JMUX proxy (unrelated to this patch):

> 0.0000-10.0519 sec  8.27 GBytes  7.07 Gbits/sec

Using the JMUX proxy, even for a simple TCP port forwarding, is
currently a whole ~86.7 slower than regular TCP port forwarding.
@CBenoit CBenoit enabled auto-merge (squash) August 12, 2024 10:00
@CBenoit CBenoit merged commit 6c18ff1 into master Aug 13, 2024
24 checks passed
@CBenoit CBenoit deleted the perf/jetsocat branch August 13, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants