Coder Social home page Coder Social logo

IoT Edge produces too much traffic with default configuration, it is not conducive for billable networks such as cellular. about iotedge HOT 13 CLOSED

uriel-kluk avatar uriel-kluk commented on August 17, 2024
IoT Edge produces too much traffic with default configuration, it is not conducive for billable networks such as cellular.

from iotedge.

Comments (13)

uriel-kluk avatar uriel-kluk commented on August 17, 2024 1

We opened a support ticket and we can close the current issue. Thanks

from iotedge.

nyanzebra avatar nyanzebra commented on August 17, 2024

@varunpuranik / @veyalla do we have any customer facing documentation on the performance breakdowns of mqtt vs amqp?

  1. This might be marketplace module specific, do you have a specific set of modules in mind? For example, the SimulatedTemperatureSensor can have a custom route defined.
  2. Believe those messages correspond to device token refreshes for connections, are you saying you want control over that frequency?
  3. The queue cleanup should be after messages are sent and doing a batch cleanup of messages from underlying store. Can double check this, but think this happens every so often to clean up state from the underlying database.

For 4,5,6 @vipeller or @varunpuranik any guidance on these?

from iotedge.

uriel-kluk avatar uriel-kluk commented on August 17, 2024

Thanks @nyanzebra,

Believe those messages correspond to device token refreshes for connections, are you saying you want control over that frequency?

My only motivation to ask about token refreshnes is to reduce traffic. I see a periodic trace every 5 minutes reauthenticating connected clients. I hope this is not creating cellular traffic.

But the main question remains the same, what is causing downloads, if the application is just pumping telemetry?
image

from iotedge.

nyanzebra avatar nyanzebra commented on August 17, 2024

@uriel-kluk is the graph for network traffic to/from device? There should be occasional twin data sent to device to see if any changes in modules need to happen as well as some connectivity checks, but would be surprised if it is significant. I think the next steps are to dig deeper.

If you have metrics it will be interesting to see what the following say:

  • edgehub_gettwin_total
  • edgeAgent_total_network_in_bytes

Additionally, if you can provide a support bundle that will be useful.

from iotedge.

uriel-kluk avatar uriel-kluk commented on August 17, 2024

from iotedge.

uriel-kluk avatar uriel-kluk commented on August 17, 2024

Hi @nyanzebra ,

Attached support bundle.

Please look at this chart:

image

It is clear that the edgeHub is renogotiating credentials every hour. Is there a way to control the frequency?
Identity attestation uses x.509 in this illustration.

Also, the custom module is doing authentication every hour. this is less impactful but yet it creates traffic.
This is the code I am using to connect the custom module with the edgeHub:
edge-device-support-bundle.tar.gz

ITransportSettings[] GetTransportSettings()
            {
                switch (transportType)
                {
                    case TransportType.Mqtt:
                    case TransportType.Mqtt_Tcp_Only:
                        return new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
                    case TransportType.Mqtt_WebSocket_Only:
                        return new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_WebSocket_Only) };
                    case TransportType.Amqp_WebSocket_Only:
                        return new ITransportSettings[] { new AmqpTransportSettings(TransportType.Amqp_WebSocket_Only) };
                    default:
                        return new ITransportSettings[] { new AmqpTransportSettings(TransportType.Amqp_Tcp_Only) };
                }
            }

            var settings = GetTransportSettings();
            var options = new ClientOptions
            {
                ModelId = ModelId,
                SasTokenTimeToLive = TimeSpan.FromDays(1),
            };

            // OpenAsync a connection to the Edge runtime
            _moduleClient = await ModuleClient.CreateFromEnvironmentAsync(settings, options);

from iotedge.

nyanzebra avatar nyanzebra commented on August 17, 2024

@uriel-kluk would you mind trying to set DeviceScopeCacheRefreshRateSecs to a much larger number (default is 3600s or 1hr). I am hoping this reduces the download quite a bit, it also shouldn't effect edgeHub really.

from iotedge.

uriel-kluk avatar uriel-kluk commented on August 17, 2024

Thank you @nyanzebra, I tried almost every parameter, but I am getting old and lazy, and because I saw the leaf description, I dismissed. Fingers crossed, this solves the issue. I should be able to provide an update in about an hour :)

Last few days with the default one hour:
image

from iotedge.

david-emakenemi avatar david-emakenemi commented on August 17, 2024

@uriel-kluk did the solution that Robert provided solve the issue?

from iotedge.

claya75 avatar claya75 commented on August 17, 2024

@david-emakenemi @nyanzebra Unfortunately, no. Thanks for all the great input on keeping our IoT Edge traffic lean on cellular. I've been digging into this with @uriel-kluk and with Wireshark I found some spots where we're using more bandwidth than we'd like or expect. I've attached some captures and charts to help illustrate.

We would love to get your take on understanding why we'd be getting so much Rx traffic on edgeHub as shown below, and/or how to reduce it.
2024-04-08 12 14 44

This screenshot is of a Wireshark capture with all Tx traffic filtered out, so this is only Rx traffic coming into our edge device, viewed both in bytes downloaded over time and the delta time between packets over time.
Rx only--bytes and delta time

This is a typical 24 hour period reported with our SuperSIM from Twilio.
image

Capture files (.pcapng) both for 2.5hrs, one with TCP and TLS only filtered.
captures.zip

from iotedge.

nyanzebra avatar nyanzebra commented on August 17, 2024

@claya75 & @uriel-kluk

Looking at the attached pcap, it looks like packets regarding certs are few and while large, aren't the majority of downloads.

When looking further it looks like there is a consistent traffic being sent from 20.49.109.144, which I assume to be your iothub, of about 135 length (TLS record len 64). Given the size, these are likely not PUBACKs within MQTT.

I will try to reproduce by setting up a local device and see if can monitor traffic w/o TLS to see if can get some answers. Will also ask IoTHub team if they have any ideas.

from iotedge.

uriel-kluk avatar uriel-kluk commented on August 17, 2024

from iotedge.

ryanwinter avatar ryanwinter commented on August 17, 2024

@uriel-kluk is this still an outstanding issue?

@nyanzebra do you have any update here?

from iotedge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.