Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
kat
kat
@zkat@toot.cat  ·  activity timestamp 6 months ago

I did a RIIR again and:

Two apps nearly-identical in functionality now. On startup, before processing anything:

#Rust + #Axum: 3.5MB RES
#Elixir + #Phoenix: 75MB RES

Literally 20x difference, and I haven't even benchmarked throughput/perf. For a use case where a big goal is extremely low resource use, this is huge.

(both of these are running in release/prod mode btw)

  • Copy link
  • Flag this post
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago

hahahahhahaa

first run is against the elixir app

second on against the rust version

lmao

Sorry, no caption provided by author
Sorry, no caption provided by author
Sorry, no caption provided by author
  • Copy link
  • Flag this comment
  • Block
Misty
Misty
@misty@digipres.club replied  ·  activity timestamp 6 months ago
@zkat Well that's significant all right
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago

and a c10k cause why not

Text copied from image

~ took 1m0s > wrk -t10 -c10000 -d60 http://localhost :3000 Running 1m test @ http:// localhost: 3000 10 threads and 10000 connections Thread Stats Latency Req/Sec 6335808 requests in 1.00m, 8.60GB read Socket errors: connect 7967, read 0, write O, timeout o Requests/sec: 105487.78 Transfer/sec: ~ took 1m0s › wrk -t10 -10000 -d60 http:// localhost:4001 Running 1m test @ http:// localhost :4001 10 threads and 10000 connections Thread Stats Avg Latency Req/Sec 455241 requests in 1.00m, 3.26GB read Socket errors: connect 7967, read 151, write O, timeout o Requests/sec: Transfer/sec:

Max 28.03k +/- Stdev 75.78% 53.36% Max 3.11k +/- Stdev 70.42% 59.66%

Avg Stdev 18. 88ms 2.72ms 39.26ms 10.61k 5.78k 146. 58MB Stdev 255.25ms 65.54ms 926.71ms 762.10 364.04 7574.21 55.51MB
Text copied from image ~ took 1m0s > wrk -t10 -c10000 -d60 http://localhost :3000 Running 1m test @ http:// localhost: 3000 10 threads and 10000 connections Thread Stats Latency Req/Sec 6335808 requests in 1.00m, 8.60GB read Socket errors: connect 7967, read 0, write O, timeout o Requests/sec: 105487.78 Transfer/sec: ~ took 1m0s › wrk -t10 -10000 -d60 http:// localhost:4001 Running 1m test @ http:// localhost :4001 10 threads and 10000 connections Thread Stats Avg Latency Req/Sec 455241 requests in 1.00m, 3.26GB read Socket errors: connect 7967, read 151, write O, timeout o Requests/sec: Transfer/sec: Max 28.03k +/- Stdev 75.78% 53.36% Max 3.11k +/- Stdev 70.42% 59.66% Avg Stdev 18. 88ms 2.72ms 39.26ms 10.61k 5.78k 146. 58MB Stdev 255.25ms 65.54ms 926.71ms 762.10 364.04 7574.21 55.51MB
Text copied from image ~ took 1m0s > wrk -t10 -c10000 -d60 http://localhost :3000 Running 1m test @ http:// localhost: 3000 10 threads and 10000 connections Thread Stats Latency Req/Sec 6335808 requests in 1.00m, 8.60GB read Socket errors: connect 7967, read 0, write O, timeout o Requests/sec: 105487.78 Transfer/sec: ~ took 1m0s › wrk -t10 -10000 -d60 http:// localhost:4001 Running 1m test @ http:// localhost :4001 10 threads and 10000 connections Thread Stats Avg Latency Req/Sec 455241 requests in 1.00m, 3.26GB read Socket errors: connect 7967, read 151, write O, timeout o Requests/sec: Transfer/sec: Max 28.03k +/- Stdev 75.78% 53.36% Max 3.11k +/- Stdev 70.42% 59.66% Avg Stdev 18. 88ms 2.72ms 39.26ms 10.61k 5.78k 146. 58MB Stdev 255.25ms 65.54ms 926.71ms 762.10 364.04 7574.21 55.51MB
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago

lol I'm a dork of course I forgot to change my ulimits. Whatever. Have a basic c2k

  • Copy link
  • Flag this comment
  • Block
hazelnot :yell:
hazelnot :yell:
@hazelnot@sunbeam.city replied  ·  activity timestamp 6 months ago
@zkat crusader 2 kings
  • Copy link
  • Flag this comment
  • Block
crypticcelery
crypticcelery
@crypticcelery@chaos.social replied  ·  activity timestamp 6 months ago
@zkat I was a bit confused by this, until I noticed the port (since the order is swapped here). Wow.
  • Copy link
  • Flag this comment
  • Block
Martin Marconcini
Martin Marconcini
@gryzor@androiddev.social replied  ·  activity timestamp 6 months ago
@zkat it's almost as if Elixir is not even trying hahaha
  • Copy link
  • Flag this comment
  • Block
Jan Lehnardt :couchdb:
Jan Lehnardt :couchdb:
@janl@narrativ.es replied  ·  activity timestamp 6 months ago
@zkat yeesh :)
  • Copy link
  • Flag this comment
  • Block
Cassandra is only carbon now
Cassandra is only carbon now
@xgranade@wandering.shop replied  ·  activity timestamp 6 months ago
@zkat Those requests per second, holy shit.
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago
@xgranade the first one is at around 100mb after that burst. Rust is at 8mb lol
  • Copy link
  • Flag this comment
  • Block
Emily_S
Emily_S
@emily_s@mastodon.me.uk replied  ·  activity timestamp 6 months ago
@zkat always fun when it has to change the units for the average request timing 😊
  • Copy link
  • Flag this comment
  • Block
Lars Wikman
Lars Wikman
@lawik@hachyderm.io replied  ·  activity timestamp 6 months ago
@zkat yeah, I adore working with Elixir but for really tight memory constraints it is not the right fit. AtomVM is kind of fun for that since they've shoved that in 400Kb of RAM iirc. But not super mature.

It depends so much on what you are up to, I reckon. I've done a decent bit of embedded linux devices with Elixir now and the entire system can run happy around 150MB.

How was your Elixir experience overall? My assumption is that Elixir would let you work mostly at a higher abstraction level but I haven't spent enough time with Rust to know :)

I know the runtime properties are very different. Tokio seems have a lot of BEAM-like features but not the same type of runtime operating system features.

  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago
@lawik I'm still maintaining a sister app using Phoenix/Elixir.

I don't really like Elixir-the-language very much, but I do think it's better than writing an Erlang again (I've done both professionally). I'm looking very closely at gleam and considering porting the bigger "sister" app to that, tbh.

  • Copy link
  • Flag this comment
  • Block
Lars Wikman
Lars Wikman
@lawik@hachyderm.io replied  ·  activity timestamp 6 months ago
@zkat fair enough, if you generally prefer Rust I think Gleam feels closer :)
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago
@lawik that's definitely a big part of it! :)
  • Copy link
  • Flag this comment
  • Block
Thomas Depierre
Thomas Depierre
@Di4na@hachyderm.io replied  ·  activity timestamp 6 months ago
@zkat not surprising tbh, definitely aiming at different environments. Totally make sense for low resource use to go with Rust there. There is a use case in "low-ish resource" for the BEAM, but it needs a lot more investment in my experience to get results.

Make sense sometimes, but eh. Not always.

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.23 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct