ndt-server icon indicating copy to clipboard operation
ndt-server copied to clipboard

ndt/7: Client side rate limiting

Open spencerbn opened this issue 4 years ago • 7 comments

I'm implementing a simple chrome-based client to run tests on a background worker. I am using the NDT/7 servers that are hosted by m-lab. While running the download test it seems like the client is being overwhelmed by the amount of messages its receiving – it's causing rendering issues and frames to be dropped even when I do no processing in the "onmessage" call.

Since Websocket doesn't seem to have any sort of built-in back-pressure method, are there recommendations for handling the large amount of messages in the client? Is there an option that can be sent when initiating the test to indicate that it's a "fragile" client?

I read through the issues and didn't see anything addressing this question. However https://github.com/m-lab/ndt-server/issues/315 seems like it could help the issue by simply stopping the test once it converges.

Please let me know if there are any recommendations for handling this. I'm really impressed with this project and grateful that all the contributors seem to work really hard to keep improving it.

spencerbn avatar Sep 22 '20 04:09 spencerbn

@SpencerLawrenceBrown First, we are encouraging developers to use https://github.com/m-lab/ndt7-js/ for new ndt7 integrations, Just wanted to ensure you were aware of that since it sounds like a web client you're developing. The first-client branch will soon be merged into a first official release. Others on the team may have more to say about #315 or other issues your client is encountering.

critzo avatar Sep 22 '20 13:09 critzo

@critzo thanks for letting me know that. I read through the code and it seems like it will suffer the same fate as my custom client since there is no feedback loop to the server. My main issue is that I am receiving so many messages the it's blocking the chrome thread and dropping frames. Seems like there isnt a solution for that currently

spencerbn avatar Sep 23 '20 03:09 spencerbn

@SpencerLawrenceBrown new issues like this one are reviewed in our team sprint planning sessions, so I expect that our team will review and comment on a possible solution.

critzo avatar Sep 23 '20 14:09 critzo

@SpencerLawrenceBrown Could you add more details on how to reproduce the issue? Did you profile it via the "Performance" tab in the developer tools? My understanding is that code running outside the main thread should not cause rendering issues / dropped frames in any case. We are actively working on the reference JS client these days (the one @critzo linked to) and if you can reproduce the issue with that one we will prioritize a fix and likely figure out why your custom client causes the main thread to slow down, too.

Since Websocket doesn't seem to have any sort of built-in back-pressure method, are there recommendations for handling the large amount of messages in the client? Is there an option that can be sent when initiating the test to indicate that it's a "fragile" client?

If you can - for example - download a file at your network speed with your browser and your hardware, with the same browser and hardware you should be able to run an ndt7 measurement without blocking the main thread. The bottleneck should always be the network speed. If we're being limited because of bugs in the code, then we definitely want to fix them. :)

Could you also say more about the network you're trying to measure (e.g. what's your expected DL/UL rate?)

robertodauria avatar Oct 06 '20 14:10 robertodauria

@stephen-soltesz

laiyi-ohlsen avatar Oct 12 '20 16:10 laiyi-ohlsen

@mattmathis

laiyi-ohlsen avatar Oct 12 '20 16:10 laiyi-ohlsen

@SpencerLawrenceBrown similar to @robertodauria's question -- can you share what the system specs are for the client machine? i.e. OS, RAM, CPU, model or year, architecture, etc, anything that might help explain what you're seeing. We've recognized that we have not yet published "recommended specs" for clients.

stephen-soltesz avatar Oct 15 '20 15:10 stephen-soltesz