Minimal data use for Balena

I am trying to create minimal bandwidth usage for my OpenBalena server as well as the BalenaOS device and hoping to clarify my understanding (benefited from https://www.balena.io/docs/reference/supervisor/bandwidth-reduction/#side-effect-warning).

Disable VPN

Disabling VPN reduces bandwidth by 43 Bytes / second and will reduce OpenBalena server upload use?

Disabling VPN doesn’t prevent any updates happening from OpenBalena, it merely means they will only occur when the RESIN_SUPERVISOR_POLL_INTERVAL activates and then use HTTPS for transfer instead?

Disabling VPN isn’t actually an advantage for reducing BalenaOS bandwidth, as the “TCP check cost” is used instead, which has slightly higher bandwidth usages (47.36 Bytes / second). It will however reduce OpenBalena server upload bandwidth (https://www.balena.io/docs/reference/supervisor/bandwidth-reduction/#data-usage-impact).

RESIN_SUPERVISOR_CONNECTIVITY_CHECK is the same as TCP check cost and therefore this can be disabled too?

VPN cannot be re-enabled later remotely, because it cannot be controlled through a container and Supervisor?

Disable CONNECTIVITY CHECK

Disable CONNECTIVITY CHECK reduces BalenaOS use but does not impact the OpenBalena server data use?

The only advantage of keeping CONNECTIVITY CHECK enable is it provides the “device’s ability to test and indicate (via an LED when available) that it has issues with connectivity”; it does not have any other detrimental impacts?

Change POLL interval to 24 hours

There is no way to disable RESIN_SUPERVISOR_POLL_INTERVAL, the best you can do is set it to its maximum which is 24 hours?

You can force a RESIN_SUPERVISOR_POLL earlier than 24 hours if you manually use the Supervisor update feature (https://www.balena.io/docs/reference/supervisor/supervisor-api/#post-v1update)?

Is a 24 hour poll setting apply from when last polled. I.e. if a device is rebooted, does the timer start again, ultimately resulting in no updates for devices that are not on for more than 24 hours, or is it 24 hours since the last successful poll?

Disable LOGS

If VPN is enabled, you can still access logs by using SSH to the device or re-enable RESIN_SUPERVISOR_LOG_CONTROL. But without VPN, there is no other way to access logs?

RESIN_SUPERVISOR_INSTANT_UPDATE_TRIGGER only applies to VPN enabled devices? Although effectively this is the same as disabling VPN, other than you retain the ability to ssh into the devices and retrieve logs?

RESIN_SUPERVISOR_CONNECTIVITY_CHECK only applies to VPN enabled devices?

“balena supervisor update poll is not configurable” (https://www.balena.io/docs/reference/supervisor/bandwidth-reduction/#data-usage-impact)?

These controls should all be RESIN_ and not BALENA_?

Quite a few questions. The straight answer to most of them is generally “yes, that’s correct” but it strikes me you’re mostly interested to keep server b/w low – this shouldn’t ever be a problem unless the server is chatting with thousands of devices, right? What is the use case?

A couple of clarifications:

  • data for application updates always goes via regular HTTPS
  • the Supervisor exposes API to enable or disable the VPN so the application can use that at will
  • last poll time is reset on reboot

Indeed, a lot of questions and reflective of how muddled I had become yesterday while writing it. The title I chose was also a little deceptive, the server bw usage was not my primary concern as much as the OS, although I did want expand my understanding of the OpenBalena server implications too.

Let me see if I can narrow down/group to a few specifics for clarification:

  1. Disabling VPN isn’t actually an advantage for reducing BalenaOS bandwidth, as the “TCP check cost” is used instead, which has slightly higher bandwidth usages (47.36 Bytes / second). However, RESIN_SUPERVISOR_CONNECTIVITY_CHECK is the control for “TCP check cost” and therefore this can be disabled too? The only advantage of keeping CONNECTIVITY CHECK enabled is it provides the “device’s ability to test and indicate (via an LED when available) that it has issues with connectivity”; it does not have any other detrimental impacts?

  2. If VPN is disabled, can it be re-enabled later remotely? My understanding is it can be by changing the ENV variable on OpenBalena, and then waiting for the poll to occur which will re-enable the VPN.

  3. You can force a RESIN_SUPERVISOR_POLL earlier than 24 hours if you manually use the Supervisor update feature (https://www.balena.io/docs/reference/supervisor/supervisor-api/#post-v1update)?

  4. These controls should all be RESIN_ and not BALENA_? Thought everything had migrated to BALENA_ in the latest supervisors?

Hi there, you are correct, RESIN_SUPERVISOR_CONNECTIVITY_CHECK just blinks the LED if disconnect according to the code, so no issue turning it off, if you don’t require that functionality.

If the supervisor polls the device state endpoint, it will reconfigure itself based on that state. So if you’ve defined RESIN_SUPERVISOR_VPN_CONTROL=true, the supervisor will attempt to re-enable VPN on after the next poll.

Yes, if you can poll on-demand by using the supervisor API on the device.

You can use RESIN_ and BALENA_ interchangeably, though we’ve put high level filters in place so that both work in the latest supervisor version(s).

Thanks for these clarifications. This may be worth changing in the docs, it would have helped me along and avoided some of these questions:

  1. Change the RESIN labels to BALENA to ensure consistency across others

  2. Add a column to the table with a corresponding env variable:

Service Usage (Including DNS overhead) Control Variable
API poll (Once per 10m) 6650 Bytes per request RESIN_SUPERVISOR_POLL_INTERVAL
balena supervisor update poll (Once every 24 hours) 6693 Bytes per request Not configurable via variables
VPN enabled 43 Bytes / second RESIN_SUPERVISOR_VPN_CONTROL
TCP check cost (When VPN disabled) 47.36 Bytes / second RESIN_SUPERVISOR_CONNECTIVITY_CHECK

I submitted the proposal for the table change on GitHub, but didn’t change the variables as presumably there would be a need to put in something that informs those using older Balena OS images to use RESIN instead.