Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long default network flush time #244

Open
wiedehopf opened this issue Jul 9, 2024 · 4 comments
Open

Long default network flush time #244

wiedehopf opened this issue Jul 9, 2024 · 4 comments

Comments

@wiedehopf
Copy link

Modes.net_output_flush_interval = 500;

500 ms seems quite a long default.
50 or 100 ms might be a good choice and not too many packets still?

@mutability
Copy link

I'm not particularly attached to 500ms, but what's the use case you're looking at here that would need a lower value?

The lower limit is going to depend on the main loop's sleep time, so ~50ms (if demodulating) or 100ms (if in net-only mode) minimum.

The flush interval only kicks in if data has not been otherwise written due to the buffer filling, which happens at the ~1300 byte mark by default; so the effective interval is going to be <500ms anyway for data rates above about 2.6kB/s

@wiedehopf
Copy link
Author

General timing precision consistency for aggregator programs for example.
Or really any other 2ndary program to do something with the data (somewhat rare).
There are no guarantees i'm well aware.

Doesn't hurt for mlat-client if you add if you add satellite internet or something to the latency (ok this is kinda far fetched).

The flush interval only kicks in if data has not been otherwise written due to the buffer filling, which happens at the ~1300 byte mark by default; so the effective interval is going to be <500ms anyway for data rates above about 2.6kB/s

So that means the latency behaviour changes unexpectedly when there is low traffic.
And it shouldn't hurt to improve that by just defaulting to 100ms.
While for typical stations it won't change the number of packets emitted most of the time as the buffer fills anyhow.

I'm not saying i have a really good argument here, but i don't really see a downside of lowering that interval.

@mutability
Copy link

I'd guess that 95% of installs are only transporting raw data locally (same host, or a host on the same local network) so maybe that's a good argument for pushing the latency right down, since lots of small writes doesn't matter so much there.

wiedehopf added a commit to wiedehopf/dump1090 that referenced this issue Jul 11, 2024
The dump1090 network outputs don't offer timing guarantees or real-time
timestamps, but it is still useful for aggregators to locally timestamp
messages they receive from dump1090 on a best-effort basis.
With lower message rates, 500 ms of flush interval can result in
significant jitter for those timestamps.
Most installs send data only on the local network or non-metered
internet connections.
If necessary this default can be adjusted via --net-ro-interval by users
who require a longer flush interval for some reason.

Reduce the default flush time to 90 ms to reliably flush every 2nd
demodulation buffer when talking to an SDR (50 ms loop) and every loop
iteration when running network-only (100 ms loop).

fixes: flightaware#244
@wiedehopf
Copy link
Author

The only concern of going to 100 or 50 ms might be people on metered mobile data connections.
But those could always change --net-ro-interval manually if it's a concern.

DSL connections won't be affected by even 50 ms flush interval.

On readsb i'm defaulting to 50 ms (with some extra special casing if it's set at 50 ms or lower and demodulating, then it flushes immediately after the demodulation buffer is processed).

100 ms will be a big improvement over 500 ms and good enough for almost all situations.
And considering for the longest time 200 ms was the effective dump1090-fa default due to the default configuration file, 100 ms will just be halfing that so it should be a somewhat conservative change in that regard.

Maybe go for 90 ms just to make sure the 100 ms timed net only loop more consistently flushes instead of comparing roughly 100 ms to 100 ms.

I'll just make a PR for 90 ms, if you would rather go to straight to 45 ms i can easily amend the PR.

#245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants