[FreeNX-kNX] NX performance issue
Fabian Franz
FabianFranz at gmx.de
Tue Mar 20 03:40:47 UTC 2007
Okay, I made some progress on that:
First how to get maximum performance (at least over small delay of time as NX seems to adapt to new bitrate ...; I can't really test all, because my CPU is to slow to handle the RAW data read/write to Xorg + nxproxies):
terminal1 $ LD_LIBRARY_PATH=nxcomp/ DISPLAY="nx/nx,link=lan,type=unix-raw,pack=no-pack:2" nxproxy/nxproxy -C :2
terminal 2 $ LD_LIBRARY_PATH=/usr/NX/lib /usr/NX/bin/nxproxy -S localhost:2
terminal 3 $ DISPLAY=127.0.0.1:2 vglrun -c 0 -dl +v glxgears
(Here was something that is strange. Even with -c 1 there was lots of traffic on NX channel and bitrate was going up to around 7 MB/s ...)
And now how to measure bitrate with nxcomp:
apply the following patch and you'll get in errors file the following logs:
Loop: Bitrate is 7102129 B/s and 3707205 B/s in 5/30 seconds timeframes.
Loop: CPU time is 21881 Ms in select and 5852 in loop.
Loop: Bitrate is 7102129 B/s and 3707205 B/s in 5/30 seconds timeframes.
Loop: CPU time is 21882 Ms in select and 5852 in loop
diff -ur ../nxcomp.old/Loop.cpp ./Loop.cpp
--- ../nxcomp.old/Loop.cpp 2006-06-19 19:55:56.000000000 +0200
+++ ./Loop.cpp 2007-03-20 03:21:08.000000000 +0100
@@ -119,6 +119,7 @@
#define PANIC
#define WARNING
+#undef INFO
#undef TEST
#undef DEBUG
#undef DUMP
@@ -172,7 +173,7 @@
// messages exceeded a given time value.
//
-#undef TIME
+#define TIME
//
// This can be useful when testing the forwarding
@@ -15180,11 +15181,13 @@
}
}
+#define TEST2
+
static void handleCheckLimitsInLoop()
{
static long int slept = 0;
- #ifdef TEST
+ #ifdef TEST2
*logofs << "Loop: Bitrate is " << control -> getBitrateInShortFrame()
<< " B/s and " << control -> getBitrateInLongFrame()
<< " B/s in " << control -> ShortBitrateTimeFrame / 1000
@@ -15192,7 +15195,7 @@
<< " seconds timeframes.\n" << logofs_flush;
#endif
- #ifdef TEST
+ #ifdef TEST2
*logofs << "Loop: CPU time is " << control -> getIdleTime()
<< " Ms in select and " << control -> getReadTime()
<< " in loop.\n" << logofs_flush;
Okay, so lets add to terminal 1 $ tail -f ~/.nx/C-2/errors &
Do you still see the bandrate limited behaviour?
Can you try to set the token size + limit higher:
int SetLinkLan()
{
[...]
control -> TokenSize = 1536;
control -> TokenLimit = 24;
Pack method does not work without nxagent.
What method do you use to measure the bandwidth?
fbxtest gives sometimes somehow strange results ...
Its interesting to see that the speed problems of nxagent/nxcomp really can only be seen on the local network for low-bandwidth it always feels better with nxagent than without ...
Anyway as direct method is faster anyway, it can be combined with nxagent. I tried it and it works.
The only thing that needs to be done (and I did it manually for now) is the translation of internal nxagent windows to external windows, but it should be really easy to have an interface to get this - even hacky over XGetAtom ;-).
That works then in both modes rootless (seamless) and normal.
That would be the combined solution you thought of in the README ;-).
My further (far, far, away) idea was even to stream the images via UDP / RTP as an image can get lost without problems and this opengl-stream has much more characteristics of video than of anything else.
cu
Fabian
More information about the FreeNX-kNX
mailing list