Thanks for the question, The delay in communication within an IoT Edge Device can be caused to several reasons. Firstly, the time taken for network reconnection plays a role example the network if its a wifi or wired. Additionally, retry mechanisms, Quality of Service (QoS) settings, and buffering strategies can also cause the delay.
Monitoring and diagnostics, along with using the latest Azure IoT Edge runtime, can help identify and address the root causes of these delays. for more info on monitoring and diagnostics kindly follow the below link
https://video2.skills-academy.com/en-us/azure/azure-monitor//vm/monitor-virtual-machine
Hope this helps, kindly accept the answer if you find it useful thanks much.