On Tue, 10 May 2011 14:09:41 -0500 DRC <dcomman...@users.sourceforge.net> wrote:
> An accurate measurement of BWmax is critical > here, though, and I don't really trust that there is a way to measure > that accurately. After trying TigerVNC's BWmax measurement, and trying to do more or less the same in TurboVNC, I am not too confident with the timing method to know BWmax. I'm just throwing out an idea: perhaps we can determine BWmax empirically. 1-Determining BWmax automatically My idea is to start TurboVNC with a high quality. When the network is the bottleneck, it will be loaded at 100% in this setup, so every two seconds apply if (bw > max_bw) max_bw = bw; (using some smoothing is a possibility but I try the simplest first) This gives a rough estimate of the maximal bandwidth - note that max_bw is always increasing, so every 30 seconds we re-evaluate it. To do that, my idea is to reset it, and force an increase in quality to load the network, and re-estimate the bandwidth : max_bw /= 2.0; appData.qualityLevel += 10; It's a hack, but I'm convinced that evidence-based empirical BWmax computation is the only way to make this work - otherwise it's way too imprecise. My testing shows pretty good results. 2-Special case: specifying BWmax As per my first mail in this thread, I have added -autoqual-bw as a commandline option, used to set up a known, constant BWmax. Useful when the user knows the bandwidth of the network, or to limit how much BW is consumed by the viewer. If you have a single viz node with a gigabit link and a standard provision of 10 users, you can use -autoqual-bw 12000 to limit each viewer to 12MB/s. 3-If you want to force reevaluating BWmax Request an ALR or manually set a high quality for JPEG, this will overload the network and speed up BWmax's increase 4-What do do with BWmax Using this to apply the algorithm we talked about earlier (target BW = 90%-95% BWmax) seems, on my limited testing done in my specific environment, to work relatively well in picking the quality. See at the bottom of this message for an output example. 5-When does this apply This is useful when : - the network is the bottleneck (this is the case on my 100Mbit/s connection with 2*2GHz CPUs on each side, by the way). - if you expect BWmax to vary during runtime because of e.g. congestion (otherwise use -autoqual-bw) - on a low latency network (I haven't tested this on a high latency network yet, but it will lead to underestimate BWmax and set a quality that is too low, perhaps this isn't a big problem) - at any rate, it can be disabled 6-Status This is merely a prototype that worked in a very, very limited test setup, but I've been building understanding and experience with VNC those past weeks, and I am more confident in this try than in the previous ones. Automatic quality adjustment is a very hairy issue, and I think a not-so-great implementation is better than the current none-at-all state of TurboVNC, and the static-and-inaccurate technique used by TigerVNC. What are your feeling about this? When I have done more testing I'll be able to show an actual patch (there is very little code, in fact). 7-Some output examples (Note that it changes the quality way too often, but that's easy to fix and for later!) 100Mbit/s Bandwidth 9511.44 kB/s (2.01 seconds) Last BW sample is outdated, resetting max_bw to 0.000000 quality set to 95, subsampling 2 Bandwidth 11013.35 kB/s (2.02 seconds) max bw 11013.351562 Link used at 100% quality set to 85, subsampling 1 Bandwidth 6865.89 kB/s (2.01 seconds) max bw 11013.351562 Link used at 62% quality set to 87, subsampling 1 Bandwidth 7224.38 kB/s (2.00 seconds) max bw 11013.351562 Link used at 65% quality set to 89, subsampling 1 Bandwidth 7840.85 kB/s (2.00 seconds) max bw 11013.351562 Link used at 71% quality set to 91, subsampling 1 Bandwidth 8603.68 kB/s (2.01 seconds) max bw 11013.351562 Link used at 78% quality set to 93, subsampling 1 Bandwidth 9719.05 kB/s (2.00 seconds) max bw 11013.351562 Link used at 88% quality set to 95, subsampling 1 Bandwidth 11172.56 kB/s (2.02 seconds) max bw 11172.559570 Link used at 100% quality set to 85, subsampling 1 Bandwidth 6854.07 kB/s (2.01 seconds) max bw 11172.559570 Link used at 61% quality set to 87, subsampling 1 Bandwidth 7208.06 kB/s (2.01 seconds) max bw 11172.559570 Link used at 64% quality set to 89, subsampling 1 Bandwidth 7841.28 kB/s (2.00 seconds) max bw 11172.559570 Link used at 70% quality set to 91, subsampling 1 Bandwidth 8647.85 kB/s (2.00 seconds) max bw 11172.559570 Link used at 77% quality set to 93, subsampling 1 Bandwidth 9721.50 kB/s (2.00 seconds) max bw 11172.559570 Link used at 87% quality set to 95, subsampling 1 4500kB/s (simulated by trickle -d 4500, so kind of inaccurate) Bandwidth 3530.50 kB/s (2.02 seconds) Last BW sample is outdated, resetting max_bw to 0.000000 quality set to 95, subsampling 2 Bandwidth 3185.69 kB/s (2.05 seconds) max bw 3185.692383 Link used at 100% quality set to 85, subsampling 1 Bandwidth 3768.04 kB/s (2.01 seconds) max bw 3768.036133 Link used at 100% quality set to 75, subsampling 1 Bandwidth 3595.85 kB/s (2.03 seconds) max bw 3768.036133 Link used at 95% quality set to 65, subsampling 1 Bandwidth 3569.32 kB/s (2.01 seconds) max bw 3768.036133 Link used at 94% Bandwidth 3626.69 kB/s (2.03 seconds) max bw 3768.036133 Link used at 96% quality set to 55, subsampling 1 Bandwidth 3669.86 kB/s (2.00 seconds) max bw 3768.036133 Link used at 97% quality set to 45, subsampling 1 Bandwidth 3599.94 kB/s (2.00 seconds) max bw 3768.036133 Link used at 95% quality set to 35, subsampling 1 Bandwidth 2776.69 kB/s (2.03 seconds) max bw 3768.036133 Link used at 73% quality set to 37, subsampling 1 Bandwidth 2873.82 kB/s (2.01 seconds) max bw 3768.036133 Link used at 76% quality set to 39, subsampling 1 Bandwidth 2978.42 kB/s (2.01 seconds) max bw 3768.036133 Link used at 79% quality set to 41, subsampling 1 Bandwidth 3018.48 kB/s (2.03 seconds) max bw 3768.036133 Link used at 80% quality set to 43, subsampling 1 Bandwidth 3145.13 kB/s (2.01 seconds) max bw 3768.036133 Link used at 83% quality set to 45, subsampling 1 Bandwidth 3214.31 kB/s (2.00 seconds) max bw 3768.036133 Link used at 85% quality set to 47, subsampling 1 Bandwidth 3310.21 kB/s (2.02 seconds) max bw 3768.036133 Link used at 87% quality set to 49, subsampling 1 Bandwidth 3370.77 kB/s (2.02 seconds) Last BW sample is outdated, resetting max_bw to 1884.018066 quality set to 59, subsampling 1 Bandwidth 3729.38 kB/s (2.01 seconds) max bw 3729.376709 Link used at 100% quality set to 49, subsampling 1 Bandwidth 3415.06 kB/s (2.02 seconds) max bw 3729.376709 Link used at 91% Bandwidth 3386.41 kB/s (2.04 seconds) max bw 3729.376709 Link used at 90% -- Greetings, A. Huillet ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ VirtualGL-Devel mailing list VirtualGL-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtualgl-devel