I am developing a skill that performs a search of an existing database. There are several intents in the interaction model, each of which is anchored by a single word such as “what” with a single slot of type AMAZON.SearchQuery. Thus an utterance would be “What is water made of?” or “Why is the sky blue?”
The skill performs as expected when tested from the developer console and from an Echo Dot. However, the performance when using the Dot is less than desirable. I have inserted log messages to track timing and used X-Ray to look at the overall Lambda function execution. The Lambda function performance is very similar with both the developer console and the Dot.
However there is a significant delay when using the Dot between the time I quit speaking the utterance and the time the response begins to be be spoken. The length of the delay is on the order of several seconds, 10 to 15 seconds to be exact passed on some rough stopwatch timing. The delay is clearly occurring prior to invoking the Lambda function and is not apparent in the X-Ray traces.
I can speculate on several reasons: 1) there is a large cold start involved when triggering the Lambda function; 2) the AMAZON.SearchQuery slot is taking a long time to be processed; 3) there is an issue determining the end of utterance; or, 4) the very short anchor phrase (one word) is giving the natural language understanding processing difficulty. Perhaps even a combination of these or other things.
I am running my Lambda function out of US West (Oregon) as opposed to US East (N. Virginia) if that makes any difference.
Skill ID: amzn1.ask.skill.fd4a2980-421a-486f-9db8-e8edd47c4b2e
Lambda ARN: arn:aws:lambda:us-west-2:334761412396:function:SmartyTalkLambdaFunction
I would appreciate any guidance on investigating and alleviating this issue. Are there any other developers experiencing similar performance issues? I’ve uploaded a .zip file with screen shots of the CloudWatch logs and the X-Ray trace for a typical utterance (specifically, “What is water made of?”); the images are of the following:
Image of Alexa Developer Console
Image of CloudWatch Log when run from Console
Image from X-Ray for opening skill from Console
Image from X-Ray for query from Console
Image from X-Ray for quit from Console
Image of CloudWatch Log when run via Dot
Image from X-Ray for opening skill via Dot
Image from X-Ray for query via Dot
Image from X-Ray for quit via Dot