Latency on local httpcalls

Development related questions, API questions and documentation, questions about integration, API/custom behaviour suggestions, how-to documents and all the nitty gritty.

AuthorPost

Latency on local httpcalls

mikerenna
 
Posts: 6
Joined: Mon Oct 20, 2014 10:00 am

Post Posted » Wed Oct 22, 2014 12:16 am

Is anyone having issues with Latency on local calls using custom behaviors? I'm seeing some outrageous times (minutes not seconds). I understand that this makes a roundtrip to the ubi server before the local call is initiated. Not keen on opening my isy944i to the outside. Is that significantly faster? Anyone else seeing that kind of delay? Any thoughts on improving it?

Thanks in advance.
Mike

Re: Latency on local httpcalls

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Thu Oct 23, 2014 5:29 pm

Hi Mike!

We've tested it out and they usually fire in <1s. When you press the test button, are you able to get a response?

If you're able to modify your script to get the time the message was received, it should indicate if it's an issue from the Ubi side.

You can also try testing locally on postman.

Re: Latency on local httpcalls

mikerenna
 
Posts: 6
Joined: Mon Oct 20, 2014 10:00 am

Post Posted » Sat Oct 25, 2014 12:55 pm

The test does seem to work in a reasonable period of time (1-2 seconds) but when i was testing some various configurations, I tried putting a voice response first, where the Ubi would say "Initiating X..." and the delay happens even before the UBI speaks the first phrase. Unfortunately no way to kick off the phrase part for testing. I'm wondering if the latency is on the round trip to the server to evaluate the speech and trigger the command. Surely the test button follows an abbreviated flow since there is no trigger evaluation. Any ideas?

Re: Latency on local httpcalls

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Sun Oct 26, 2014 4:00 pm

It does seem to be a latency issue then. I'd suggest this test:

Get a laptop or Android/iPhone. Run speedtest.net right next to your router and then again where your Ubi is located. It could be that there's something there causing an issue with your WiFi speed. In that case, every reduction in speed cases a 4x increase in latency.

If this is the case, you can try some different placements.

Hope this helps!

Re: Latency on local httpcalls

mikerenna
 
Posts: 6
Joined: Mon Oct 20, 2014 10:00 am

Post Posted » Tue Oct 28, 2014 7:59 am

Placement does seem to be part of the issue. Question: My router has two access points, with one being 2.4GHz and one being 5GHz. can you Ubi connect make a 5GHz connection? How can you force the UBI to connect to a specific access point when it powers up? Thanks in advance.

Re: Latency on local httpcalls

mikerenna
 
Posts: 6
Joined: Mon Oct 20, 2014 10:00 am

Post Posted » Sun Nov 02, 2014 5:52 pm

Ok thanks to an email exchange I know the ubi doesnt do 5ghz yet.ive reworked my network topology and have the ubi extremely close to an access point. I'm starting to think the latency isn't primarily geographic placement. Any other ideas on testing?

Re: Latency on local httpcalls

mikerenna
 
Posts: 6
Joined: Mon Oct 20, 2014 10:00 am

Post Posted » Mon Nov 03, 2014 12:06 am

For testing purposes, i created a simple custom behavior with an utterance trigger and voice response. Log shows the time at about a second between trigger and response. However my custom behaviors that call local web service show a full minute response in the log. When using the test button in the editor the web service responds in about a second. So I'm baffled on where the latency is coming from. Does an utterance trigger/voice response follow some other path to you and back than an utterance/local http call?

Re: Latency on local httpcalls

JasonUser avatar
Admin/Team Ubi
 
Posts: 295
Joined: Thu Apr 10, 2014 4:17 pm

Post Posted » Wed Nov 12, 2014 2:15 am

Regardless of network infrastructure or configuration, waiting minutes and having success means the software isn't working. Local request do not make a round trip to the cloud. The android inside simply make a direct call the the url you define as your local request.

So in your local server you should be able to see when a request is received, make a request from Ubi then check your local server, what is lagging behind - Ubi or your server. In my local setup I have Ubi fire a request to my computer, as soon as Ubi light goes off after I talk, I can see the request hit my server, it's instant, my computer use ethernet while Ubi use wifi (2.4GHz).

Someone else reported this but we have not been able to replicate it on our end.

I have several web servers on my computer and they are all basically instant.

Re: Latency on local httpcalls

mikerenna
 
Posts: 6
Joined: Mon Oct 20, 2014 10:00 am

Post Posted » Wed Nov 12, 2014 7:05 pm

Thanks for the troubleshooting ideas. No smoking gun yet. In looking at web server logs, i'm seeing the web call hit not hit the web server for a minute. Once it's there, the response is immediate and even the next step from the UBI (confirmation utterance is immediate). So something is keeping the call from going out for a minute. The worst part is that every now and then it executes flawlessly so it isn't every time that the delay is there. However, still about 75%+ of the time it has a delay. I've thoroughly checked bandwidth and proximity to access points. I've tried various UCBs to see if I can eliminate any variables. No luck. Please just don't give up on me here. Surely we'll come up with some way to figure this out. -Mike

Re: Latency on local httpcalls

JasonUser avatar
Admin/Team Ubi
 
Posts: 295
Joined: Thu Apr 10, 2014 4:17 pm

Post Posted » Thu Nov 13, 2014 12:59 am

Ok so there is a delay between when you activate the trigger and when the local request hits the server? Meaning you can trigger the trigger and the local request shows up in your server log a minute later. If this is true then yes there must be a problem with our software.

Can you post the URL you tried, can you also try this URL on another device you have? We have reports that authentication via url causes a delay but we have been unable to replicate this, after trying multiple times too. Like I said I have tried multiple web servers and they were all instant, I'm trying to figure out if it's a configuration problem.

Are you able to tell me a little bit about your web server. You can PM it to me.

Re: Latency on local httpcalls

millahjovich
 
Posts: 5
Joined: Tue Jun 21, 2016 3:56 am

Post Posted » Tue Jun 21, 2016 7:07 am

The test does seem to work in a reasonable period of time (1-2 seconds) but when i was testing some various configurations, I tried putting a voice response first, where the Ubi would say "Initiating X..." and the delay happens even before the UBI speaks the first phrase. Unfortunately no way to kick off the phrase part for testing. I'm wondering if the latency is on the round trip to the server to evaluate the speech and trigger the command. Surely the test button follows an abbreviated flow since there is no trigger evaluation. Any ideas?
Hello I am Millah