Summary: | Some Java applications are slow on remote X connections | ||
---|---|---|---|
Product: | XCB | Reporter: | Juha Erkkilä <Juha.Erkkila> |
Component: | Library | Assignee: | xcb mailing list dummy <xcb> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | high | CC: | jerickson, wollw |
Version: | 1.1 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
tshark-dump of one keypress with XCB linked in
tshark-dump of one keypress without XCB Patch to disable nagle algorithm on XCB network sockets |
Description
Juha Erkkilä
2008-10-02 03:59:24 UTC
Created attachment 19337 [details]
tshark-dump of one keypress without XCB
FYI, I have triaged this issue with Ubuntu Launchpad. Please see https://bugs.launchpad.net/libxcb/+bug/277069 for additional submitted comments and information. Also, see the following threads for more information regarding this issue: http://sourceforge.net/mailarchive/forum.php?thread_name=81910.36206.qm%40web62007.mail.re1.yahoo.com&forum_name=ltsp-discuss http://www.typingmaster.com/forum/messages.aspx?TopicID=11 I think this could be related to what I was experiencing for GLX over network. Running any GLX application over network was horribly slow. I then found out that running GLX application over network loopback on the same machine was event slow. Ie i tested the following. DISPLAY=localhost:0.0 LIBGL_ALWAYS_INDIRECT=1 xbmc vs DISPLAY=:0.0 LIBGL_ALWAYS_INDIRECT=1 xbmc where xbmc being XBMC Media Center is a opengl application. The first test gave a fps of 10, while the second a fps 40 on my hardware. After some pondering i thought about the nagle algorithm. After modifying libxcb to disable the nagle algorthim, the above two commands rendered at about the same speed of 40fps. I'll attach a diff. Created attachment 26071 [details] [review] Patch to disable nagle algorithm on XCB network sockets My patch seems to have solved the issue for the people affected by this bug. There might be an alternate approach that would incure less overhead due to TCP_NODELAY. One could instead of having TCP_NODELAY enabled all the time, only enable it on the socket on a call to _XFlush(), then disable. I'm not sure how the kernel would like this setting being enabled and disabled all the time thou. Disabling Nagle sounds pretty reasonable to me. It's also what Xtrans (and thus traditional Xlib) does. commit ee89850e68205a7f8961ace0839b5be86040dade Author: elupus <elupus@ecce.se> Date: Tue May 26 16:14:48 2009 +0200 Disable Nagle on TCP socket Signed-off-by: Julien Danjou <julien@danjou.info> (In reply to comment #8) > commit ee89850e68205a7f8961ace0839b5be86040dade > Author: elupus <elupus@ecce.se> > Date: Tue May 26 16:14:48 2009 +0200 > > Disable Nagle on TCP socket > > Signed-off-by: Julien Danjou <julien@danjou.info> > I can't believe we had Nagle on. :-) Oops. Thanks much to all for the diagnosis and fix. Wouldn't it be a better option to use TCP_CORK and to "pull the cork" in _XFlush()? See http://baus.net/on-tcp_cork for a more elaborate description of this feature. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.