RecordEvolution / ReswarmOS

A small, customized host operating system for IoT devices meeting the needs of Reswarm
Apache License 2.0
5 stars 0 forks source link

prioritize reagent network usage #28

Closed mario-fink closed 3 years ago

mario-fink commented 3 years ago

especially in low bandwidth scenarios the ping pong should have high priority.

https://superuser.com/questions/309063/how-can-i-prioritise-network-bandwidth-on-a-per-application-basis

related to https://github.com/RecordEvolution/DeviceManagementAgent/issues/35

DewitteRuben commented 3 years ago

I did some testing this morning with: nethogs (https://github.com/raboof/nethogs) to see bandwidth usage of the agent

It appears that whenever you upload a file, or perform any other larger upload task, with limited upload speed (lets say you only have 20kb/s upload), it causes the upload bandwidth for the reagent process to drop to 0 which causes the disconnect. The agent then tries to reconnect but doesn't appear to get any bandwidth due to the other process(es) taking priority.

On idle the agent uses about 0.05kb/s in bandwidth (average, both up and down) so if the bandwidth never drops below that, it should technically never disconnect. A buffer of a few kilobytes in bandwidth would probably be enough to ensure the stability of the connection.

Also: Whenever the agent has to upload a constant log stream (10ms/log from 1 app) it can take 20kb/s + more in upload speed when it's not being throttled.

mario-fink commented 3 years ago

https://linux.die.net/man/1/trickle https://wiki.debian.org/TrafficControl https://tldp.org/HOWTO/Traffic-Control-HOWTO/intro.html