From: "Daniel P. Berrange" <berrange@redhat.com>
To: Brian Rak <brak@gameservers.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] QEMU websockets support is laggy?
Date: Mon, 30 Jan 2017 10:51:47 +0000 [thread overview]
Message-ID: <20170130105147.GF27325@redhat.com> (raw)
In-Reply-To: <20170127180820.GA6273@redhat.com>
On Fri, Jan 27, 2017 at 06:08:20PM +0000, Daniel P. Berrange wrote:
> On Fri, Jan 27, 2017 at 09:35:38AM +0000, Daniel P. Berrange wrote:
> > On Tue, Jan 24, 2017 at 05:02:25PM -0500, Brian Rak wrote:
> > > We've been considering switching over to using qemu's built in websockets
> > > support (to avoid the overhead of needing websockify running). We've been
> > > seeing very poor performance after the switch (it takes the console 4-5
> > > seconds to update after pressing a key). So far, I haven't been able to
> > > find any indication of why this is happening. The exact same configuration
> > > works perfectly when running with websockify, but laggy when hitting qemu
> > > directly.
> > >
> > > I've tried a few things (disabling encryption, bypassing our usual nginx
> > > proxy, even connecting via a ssh tunnel), and haven't made any sort of
> > > progress here. Has anyone else seen this? Any suggestions as to where I
> > > should start looking?
> >
> > Can you clarify the exact setup you have ? As mentioned on IRC, I don't
> > see any degradation in performance betweeen builtin websockets vs a
> > websockets proxy - if anything the builtin websockets is marginally less
> > laggy. I was connecting over TCP localhost, however, so would not see
> > any effects of network latency. My test was QEMU git master, with noVNC
> > git master.
>
> It turns out that to see the problem you have a wait a while - the
> connection is initially fine, but gets worse over time. Using a TCP
> connection seems to make it get worse more quickly.
>
> After a painful debugging session I've discovered the problem is that
> QEMU is reading data off the socket, decoding a websockets packet and
> then processing it. The problem is if the read off the socket gets
> multiple websockets packets at once, it only decodes the first packet.
> The remaining packets aren't decoded until more data arrives on the
> socket. This gets progressively worse & worse. I'll send a patch for
> this next week...
I've just sent a patch & would appreciate your testing to confirm that
it fixes the problem for you too.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
next prev parent reply other threads:[~2017-01-30 10:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 22:02 [Qemu-devel] QEMU websockets support is laggy? Brian Rak
2017-01-26 20:06 ` Dr. David Alan Gilbert
2017-01-27 9:35 ` Daniel P. Berrange
2017-01-27 18:08 ` Daniel P. Berrange
2017-01-30 10:51 ` Daniel P. Berrange [this message]
2017-01-30 16:16 ` Brian Rak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170130105147.GF27325@redhat.com \
--to=berrange@redhat.com \
--cc=brak@gameservers.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).