Skip to content

Commit 18582a4

Browse files
Merge pull request #280560 from PatAltimore/patricka-message-cleanup
Add message queue cleanup troubleshooting
2 parents 9690656 + 714e065 commit 18582a4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

articles/iot-edge/troubleshoot-common-errors.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Resolve common issues in Azure IoT Edge solutions. Learn how to tro
44
author: PatAltimore
55

66
ms.author: patricka
7-
ms.date: 06/06/2024
7+
ms.date: 07/10/2024
88
ms.topic: troubleshooting-general
99
ms.service: iot-edge
1010
services: iot-edge
@@ -363,6 +363,22 @@ You don't need to disable socket activation on a distribution where socket activ
363363
1. Change the iotedge config to use `/var/lib/iotedge/*.sock` in both `connect` and `listen` sections
364364
1. If you already have modules, they have the old `/var/run/iotedge/*.sock` mounts, so `docker rm -f` them.
365365

366+
### Message queue clean up is slow
367+
368+
#### Symptoms
369+
370+
The message queue isn't being cleaned up after messages are processed. The message queue grows over time and eventually causes the IoT Edge runtime to run out of memory.
371+
372+
#### Cause
373+
374+
The message cleanup interval is controlled by the client message TTL (time to live) and the *EdgeHub* *MessageCleanupIntervalSecs* environment variable. The default message TTL value is two hours and the default *MessageCleanupIntervalSecs* value is 30 minutes. If your application uses a TTL value that is shorter than the default and you don't adjust the *MessageCleanupIntervalSecs* value, expired messages won't be cleaned up until the next cleanup interval.
375+
376+
#### Solution
377+
378+
If you change the TTL value for your application that is shorter than the default, also adjust the *MessageCleanupIntervalSecs* value. The *MessageCleanupIntervalSecs* value should be significantly smaller than the smallest TTL value that the client is using. For example, if the client application defines a TTL of five minutes in the message header, set the *MessageCleanupIntervalSecs* value to one minute. These settings ensure that messages are cleaned up within six (5 + 1) minutes.
379+
380+
To configure the *MessageCleanupIntervalSecs* value, set the environment variable in the deployment manifest for the IoT Edge hub module. For more information about setting runtime environment variables, see [Edge Agent and Edge Hub Environment Variables](https://github.com/Azure/iotedge/blob/main/doc/EnvironmentVariables.md).
381+
366382
## Networking
367383

368384
### IoT Edge security daemon fails with an invalid hostname

0 commit comments

Comments
 (0)