1

We use Azure IOT and edgeHub and edgeAgent as modules for Edge runtime. We want to verify the capability of Offline storage is configured correctly in our environment

We have custom simulator module connected to custom publisher module that publishes to an API in the Cloud. The simulator is continuously producing a message around 10KB every 2 seconds. The publisher module could not talk outside because of a blocking firewall rule. I want to verify all the memory/RAM allocated for edgeHub is used and later overflows to disk and uses reasonable available disk space.

This exercise is taking longer to complete even when I run multiple modules/instances of simulator.

Queries:

  1. How can I control the size of memory allocated to edgeHub. What is the correct createOptions to control/reduce allocated memory. It is currently allocated around 1.8GB.

  2. I see generally during the exercise, RAM keeps increasing. But at some point, it drops down a little and keeps increasing after. Is there some kind of GC or optimization happening inside edgeHub?

    b0fb729d25c8        edgeHub                 1.36%               547.8MiB / 1.885GiB   28.38%              451MB / 40.1MB      410MB / 2.92GB      221
    
  3. How can ensure that any of the messages produced by simulator are not lost. Is there a way to count the number of messages in edgeHub?

  4. I have done the proper configuration to mount a directory from VM to container for persistent storage. Is there a specific folder inside edgeHub folder under which messages would be stored when overflown?

Rag
  • 1,363
  • 4
  • 19
  • 36
  • I think this file gives good insights on how storage works in edgeHub module: https://github.com/Azure/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/storage/MessageStore.cs – asergaz Jan 24 '19 at 11:29
  • Also see here: https://learn.microsoft.com/en-us/azure/iot-edge/offline-capabilities – asergaz Jan 24 '19 at 11:37
  • @sergaz-msft thanks for replying. i have seen the offline-capabilities page before. i observer1.88GB allocated for edgeHub when there is only 2GB available on VM. I believe the system swaps before even edgeHub overflows to disk. Do you know how to control memory allocated for a container? I want to verify messages overflow in our setup. – Rag Jan 25 '19 at 13:28
  • Hi Rag, I believe that most of your questions in this thread were answered [here](https://github.com/MicrosoftDocs/azure-docs/issues/23265) and [here](https://stackoverflow.com/questions/54688682/iotedge-how-to-requeue-message-that-could-not-be-processed). Can you rephrase the question and\or post the answer to your questions so others can learn? Thanks. – asergaz Feb 27 '19 at 11:24

2 Answers2

2

I will document the answers after the input I have received from Azure IoTHub/IoTEdge maintainers.

  • To control memory limit of containers/modules on Edge, specify as below with appropriate max memory limit in bytes
"createOptions": "{\"HostConfig\": { \"Memory\": 536870912 }}"
  • Messages are persistent because the implementation is RocksDB which stores to disk by default

  • To make the messages persistent even after edgeHub container recreation, mount a directory from Host to Container. In the example below /data from Host is mounted to appropriate location within edgeHub

            "env": {
                "storageFolder": {
                    "value": "/data"
                }
            }
Rag
  • 1,363
  • 4
  • 19
  • 36
0

To monitor the memory usage the metrics feature will be generally available in the 1.0.10

Monitor IoT Edge Devices At-scale

Juri
  • 1,531
  • 2
  • 20
  • 43