this post was submitted on 12 Aug 2024
89 points (95.9% liked)

Opensource

1120 readers
42 users here now

A community for discussion about open source software! Ask questions, share knowledge, share news, or post interesting stuff related to it!

CreditsIcon base by Lorc under CC BY 3.0 with modifications to add a gradient



founded 11 months ago
MODERATORS
 

cross-posted from: https://lemm.ee/post/39429103

top 11 comments
sorted by: hot top controversial new old
[–] ShellMonkey@lemmy.socdojo.com 5 points 1 month ago (1 children)

A lovely tool to have on the home net to help confirm things are working as expected.

[–] BB_C@programming.dev 3 points 1 month ago (1 children)

That's what iperf3 is for.
No Flash, No Java, No Websocket, No Webshit.

[–] ShellMonkey@lemmy.socdojo.com 3 points 1 month ago (1 children)

Also a nice tool, but not nearly as convenient if you want to just pull a quick test from a phone for example.

[–] BB_C@programming.dev 2 points 1 month ago

I wouldn't make this argument in, for the lack of a better word, a "normie" space, but iperf3 can indeed be quickly used from your phone. It's even packaged for Termux.

[–] Boomkop3@reddthat.com 3 points 1 month ago* (last edited 1 month ago) (1 children)

Wait, why would you not use a websocket for this?

[–] kolorafa@lemmy.world 1 points 3 weeks ago (1 children)

My guess that websocket add additional overhead both in size (header) and complexity as browser and server need to encode/decode it making it more CPU intensive not to mention harder to implement.

[–] Boomkop3@reddthat.com 1 points 3 weeks ago (1 children)

I've implemented it myself, down to the encoding and buffer management.

It's a really simple back and forth first, but after that it's just dumping arbitrary binary data through the socket

[–] kolorafa@lemmy.world 1 points 3 weeks ago (1 children)

Yes, but with WebSocket you need to have a server and that will consume some additional CPU.

Without it you only need some random CDN to do the download test.

[–] Boomkop3@reddthat.com 1 points 3 weeks ago (1 children)

This server is just a piece of software that accepts and responds to TCP sockets. It could be anything, but you're not consuming more CPU power by doing less work.

The http protocol requires you prepend every message with a bunch of headers and for them to have a static size. (tho plenty of apps allow you to bend the rules quite a bit)

After switching to a websocket, none of that applies. You can just dump data straight into the TCP socket. Or TLS stream that goes into the TCP socket. But that would be same for the http requests

[–] kolorafa@lemmy.world 1 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

On the server side to send you data, using any web server with mmap support will probably be less CPU intensive than app that handles websocket, but yes, the details matter as when reading a lot of small files vs websocket, then websocket could be better for CPU usage especially when you could generate data.

But once again using plain old http allow you to use the speestest software against any CDN very easy IMO.

[–] Boomkop3@reddthat.com 1 points 3 weeks ago

Adding headers and some other minor requirements is slower than not. That's really the difference, it's not complicated.