Agent responding very slow

Has something changed recently?

My imp has been working fine for years, opening and closing my garage door, but a few days ago it stopped working.

The device is online, and sending temperatures and such back to my server just fine, but when I access the agent url, it takes a long time to respond. Some of the shortest response time, has been 3 minutes, and I have had many +10 minutes, when I stopped waiting for it.

Can you PM with a device ID & agent code? We can look at the audit logs.

My personal ones still respond in a fraction of a second - could it be the HTML you’re serving from your agent is referring to some external resources which have moved maybe?

Now it is fast again, sometimes. It goes from responding almost instantly, to taking 3-5 seconds.

The agent is only serving some json, no external resources are used.

Looking in the logs, this appears to be because you are using sendsync() in your agent; as these are synchronous calls, if the host you are talking to with those outbound HTTP requests is slow, the agent is blocked from running any other code during this time.

If you change to sendasync() instead for your outbound calls, then the destination host being slow does not prevent the agent from servicing inbound HTTP requests.

Thank you for your help, it has been changed to async and is now working as intended again. :slight_smile: