Replies: 1 comment 13 replies
-
Can you link the source code for both the erlang implementation and the client? This will make it easier to step through the differences and speed up the server. The examples echo server is not the most well-optimized, as it is there to be a simple example to show how to do simple things with tokio. Without the client, I can't easily tell what exactly is being done or measured here. Typically, for something like this, I would create a set of histograms showing the various distributions of latencies with varying amounts of simultaneous clients running. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I used basic TCP echo server with Tokio from github and I developed a simple clients for testing the echo server
with one client Tokio server and simple Erlang echo server behave the same but as soon as I increase the clients
tokio gets slower. what optimization I should do on tokio sample?
result for 255 clients each one sending 1000 msg(each 85 bytes) data simultaneously
Erlang result:
(cargo build --release)
Tokio result:
[[package]]
name = "tokio"
version = "1.12.0"
Linux 5.14.7-arch1-1 #1 SMP PREEMPT Wed, 22 Sep 2021 21:35:11 +0000 x86_64 GNU/Linux
rustc 1.55.0 (c8dfcfe04 2021-09-06)
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 43 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 7 2700X Eight-Core Processor
CPU family: 23
UPDATE : Sample codes.
compile erlang codes with erlc *.erl
for running single clinet:
time erl -noshell -s single_client start
single_client.erl:
for running multiple clinet:
time erl -noshell -s multi_client start
multi_client.erl:
You can change number of concurrent client on this line
CIDs = lists:seq(1,255),
on my AMD Ryzen 8 Core CPU I set it to 255 with no problem but on my Mac M1 I should change it to 5 !
for running erlnag echo server :
erl -noshell -s echo_server start
echo_server:
rust echo server :
I did not implement reading packet size so I changed buffer size to 87 (size of dummy msg)
change it to 1024 does not have any effect
Beta Was this translation helpful? Give feedback.
All reactions