locked
Number of messages used from iot edge RRS feed

  • Question

  • Goodmorning,

    I have seen on iot hub's metric some strange values..  I have actually one edge ( raspberry) power on with only two modules running, edgeAgent and edgeHub. Other modules are currently stopped.

    - Max Successful twin reads from devices --> one per hour

    - Avg Response size of twin reads from devices  --> about 9.3 KB  one time each hour

    - Total number of messages used --> it increased by about 30 messages every hour, probably because one twin read it will be count with block's size of 512 bytes

    What do these updates actually do every hour ?

    Why does my number of messages increase for automatic device operations? Can i reduce the frequency ?


    So, i looked into iot edge logs, and i saw on edgeHub'logs :

    2019-04-09 02:10:20.729 +00:00 [INF] - Starting compaction of stores
    2019-04-09 02:10:20.730 +00:00 [INF] - Starting compaction of store default
    2019-04-09 02:10:20.730 +00:00 [INF] - Starting compaction of store checkpoints
    2019-04-09 02:10:20.730 +00:00 [INF] - Starting compaction of store twins
    2019-04-09 02:10:20.731 +00:00 [INF] - Starting compaction of store messages
    2019-04-09 02:10:20.731 +00:00 [INF] - Starting compaction of store sessions
    2019-04-09 02:10:20.731 +00:00 [INF] - Starting compaction of store DeviceScopeCache
    2019-04-09 02:10:20.757 +00:00 [INF] - Starting compaction of store iothub
    2019-04-09 02:10:29.760 +00:00 [INF] - Reauthenticating connected clients
    2019-04-09 02:10:30.114 +00:00 [INF] - Starting refresh of device scope identities cache
    2019-04-09 03:10:29.749 +00:00 [INF] - Reauthenticating connected clients
    2019-04-09 03:10:30.763 +00:00 [INF] - Starting refresh of device scope identities cache
    2019-04-09 04:10:20.721 +00:00 [INF] - Starting compaction of stores
    2019-04-09 04:10:20.721 +00:00 [INF] - Starting compaction of store default
    2019-04-09 04:10:20.722 +00:00 [INF] - Starting compaction of store checkpoints
    2019-04-09 04:10:20.722 +00:00 [INF] - Starting compaction of store twins
    2019-04-09 04:10:20.722 +00:00 [INF] - Starting compaction of store messages
    2019-04-09 04:10:20.723 +00:00 [INF] - Starting compaction of store sessions
    2019-04-09 04:10:20.723 +00:00 [INF] - Starting compaction of store DeviceScopeCache
    2019-04-09 04:10:20.743 +00:00 [INF] - Starting compaction of store iothub
    2019-04-09 04:10:29.749 +00:00 [INF] - Reauthenticating connected clients
    2019-04-09 04:10:31.471 +00:00 [INF] - Starting refresh of device scope identities cache
    2019-04-09 05:10:29.751 +00:00 [INF] - Reauthenticating connected clients
    2019-04-09 05:10:32.120 +00:00 [INF] - Starting refresh of device scope identities cache
    2019-04-09 06:10:20.719 +00:00 [INF] - Starting compaction of stores
    2019-04-09 06:10:20.719 +00:00 [INF] - Starting compaction of store default
    2019-04-09 06:10:20.814 +00:00 [INF] - Starting compaction of store checkpoints
    2019-04-09 06:10:20.815 +00:00 [INF] - Starting compaction of store twins
    2019-04-09 06:10:20.815 +00:00 [INF] - Starting compaction of store messages
    2019-04-09 06:10:20.815 +00:00 [INF] - Starting compaction of store sessions
    2019-04-09 06:10:20.815 +00:00 [INF] - Starting compaction of store DeviceScopeCache
    2019-04-09 06:10:20.834 +00:00 [INF] - Starting compaction of store iothub
    2019-04-09 06:10:29.755 +00:00 [INF] - Reauthenticating connected clients
    2019-04-09 06:10:32.830 +00:00 [INF] - Starting refresh of device scope identities cache
    2019-04-09 07:10:29.749 +00:00 [INF] - Reauthenticating connected clients
    2019-04-09 07:10:33.502 +00:00 [INF] - Starting refresh of device scope identities cache
    







    Tuesday, April 9, 2019 10:09 AM

Answers

All replies

  • Thanks for your feedback Greta,

    We are looking at this internally. Please bear with me.

    Tuesday, April 9, 2019 3:50 PM
  • Hello Greta,

    The Edge Agent periodically syncs the deployment to prevent us from ever "bricking" the device. The default period for this sync is 1 hour, which is what you are seeing here.

    This period can be adjusted by setting the "ConfigRefreshFrequencySecs" environment variable in the Edge Agent.

    See: https://github.com/Azure/iotedge/blob/f43ccb30b58dfba87a479a8afd0b7db21834680b/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Service/appsettings_agent.json


    Tuesday, April 9, 2019 5:05 PM
  • Thanks a lot!

    So, is it only used for sync deployment?

    How can i change it for edgeAgent? I think i should edit deployment.json, adding env section for edgeModule.

    If i will change the ConfigRefreshFrequencySecs to 6 hours, what happens if i  I create a new pipeline deployment in the middle of the six hours? It will immediately applied or after 6 hours?

     

    Wednesday, April 10, 2019 8:34 AM
  • Good morning,

    I tried to put ConfigRefreshFrequencySecs in different places in my deployment.json and also inside the config.yaml, but it seems edgeHub doesn't use the new value.

    In deployment.json i tried to insert it both for edgeAgent and edgeHub. I noticed  only  logLevel can use a new value.

    "systemModules": {
              "edgeAgent": {
                "type": "docker",
                "env": {
                  "ConfigRefreshFrequencySecs": {
                    "value": 1800
                  }
                },
                "settings": {
                  "image": "mcr.microsoft.com/azureiotedge-agent:1.0",
                  "createOptions": "{}"
                }
              },
              "edgeHub": {
                "type": "docker",
                "status": "running",
                "restartPolicy": "always",
                "env": {
                  "ConfigRefreshFrequencySecs": {
                    "value": 800
                  },
                  "RuntimeLogLevel": {
                    "value": "debug"
                  }
                },
                "settings": {
                  "image": "mcr.microsoft.com/azureiotedge-hub:1.0",
                  "createOptions": "{}"
                }
              }
            }

    And i tried also to put it inside config.yaml, i noticed that is taked it but with first lowercase char. This with the command line " docker exec -it edgeHub env "

    agent:
      name: "edgeAgent"
      type: "docker"

      config:
        image: "mcr.microsoft.com/azureiotedge-agent:1.0"
       env : { ConfigRefreshFrequencySecs : 800 }

    auth: {}


    Where  i should  insert it ?


    • Edited by Greta_S93 Tuesday, April 16, 2019 7:39 AM
    Tuesday, April 16, 2019 7:38 AM
  • Hello Greta,

    You may be running into a known issue with triggering an update of the Edge Agent module specifically. Currently only changing the "image" field triggers a redeployment of the Edge Agent module.

    The env setting you have should work. I would update the "image" field to mcr.microsoft.com/azureiotedge-agent:1.0.7 to trigger the redeployment.

    Let us know the result?

    Thanks!

    Monday, May 13, 2019 3:43 PM
  • I have tried, but nothing to do.... any news ?
    Tuesday, July 16, 2019 7:16 AM
  • Hi Greta,

    This may be a bug in the SDK and we need to validate. Can I kindly ask you to file a new issue on the SDK repo?

    https://github.com/Azure/iotedge/issues

    Thank you so much. Please inform here the link to the issue created so others can follow as well :).

    Friday, July 19, 2019 11:45 AM
  • Of course,

    here the issue opened https://github.com/Azure/iotedge/issues/1462 

    Monday, July 22, 2019 10:03 AM
  • Is there any documentation about edgeAgent's setting  from  here 
    Thursday, July 25, 2019 12:34 PM