playsign / fidemo

FIWARE Demo / Integration project
Other
16 stars 6 forks source link

Improve HSL data getting #5

Open antont opened 9 years ago

antont commented 9 years ago

Currently we get the HSL data for busses, trams and metros via CIE's POI server. It polls some HSL endpoint (I don't know which exactly, Stinkfist was asking on IRC but we didn't find the info) every 10 seconds now.

This is basically ok - we can show the objs and they move.

However there are two problems:

  1. The update is quite rare. 10secs is too long an interval for showing moving objects. Tapani is adding client-side interpolation to make it smooth but still it's a rare update.
  2. The HTTP get to the POI server from the client here stalls sometimes. Can take a minute or so to timeout then. Chrome's network debugging tool shows 'request stalled' or so. We've been unable to repeat the problem with manual use of the browser (just refreshing the POI link) -- use jquery's $.getJSON in the code where it happens. We haven't debugged this yet.

Possible solutions:

A. Use HSL service directly, either from Tundra server side or from the Web browser.

B. Keep using the POI intermediate server but debug the stalling, and investigate if the update freq could be e.g. 1 or 3 secs. Or live with 10.

A good benchmark is the existing 2d service with this data, it updates pretty quick and reliably: http://transport.wspgroup.fi/hklkartta/

We decided yesterday in the meet that Admino will work on this data retrieval so assigning to Ali as we agreed on IRC where just discussed this.

antont commented 9 years ago

@Stinkfist0 are you on this btw? i mean the stalling prob is afaik still there.

Stinkfist0 commented 9 years ago

Haven't been actively researching this. Haven't noticed any problems though.

antont commented 9 years ago

I got this immediately in the beginning now with the current version:

screen shot 2014-12-16 at 16 41 02

After taking the screenshot (at 20sec or so 'pending') it lasted exactly 1.0 minutes for the data to come.

And now the 2nd request is again 'pending' as well. Apparently took also 1.0 minutes .. and now 3rd one is pending:

screen shot 2014-12-16 at 16 43 10

You never get these?

Am on a slow mac with poor fps for the demo but Tapani reported this originally from a beefier win desktop.

Stinkfist0 commented 9 years ago

Aight, getting and noticing that myself too now.

erno commented 9 years ago

After a ~40 requests I got this to replicate with vanilla wget as well,

for i in $(seq 10); do time wget -O/dev/null -q http://dev.cie.fi/FI-WARE/mlevanto/dynpoi/server/radial_search; sleep 1; done ... wget -O/dev/null -q 0.00s user 0.01s system 0% cpu 1:01.78 total