Optimize response time, own cloud and Alexa skill

Hi,
I finally managed to get my own openhab cloud server going in connection with Alexa. The functions are working, however I noticed that the response/action after the Alexa command takes a few seconds longer (to the extent I am wondering whether it is working at all) than with the myopenhab server.
The official skill and myopenhab were almost instantenous.

Are there specific recommended settings for the lambda function or is it purely reliant on the processing power of my own cloud server?

That’s because any AWS Lambda function has a cold start time when it’s not used for about 30-45 minutes. Since there are a constant amount of requests coming from the official Alexa skill, this is not a factor at that level but it certainly is when setting up your own instance. You probably noticed that the first request may take longer and the subsequent requests are fine.

The only solution to this is to keep the function warm. There are a bunch of tutorial online on how to do so. The easier way is to create a recurring scheduled AWS dummy event to trigger the function.

On a side note, if all your requests have latency, it might be related to your own cloud server response time then.

2 Likes

Hi jeremy,

Indeed i just tested it and the first call is definitely the slowest, as Alexa was not used for some time now. Consecutive calls are faster and are most often executed before the Echo gives the “acknowledge”- PING

I will look into this dummy event. Thanks for the pointer.

1 Like