<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5">
</HEAD>
<BODY>
Hi Frediano,<BR>
<BR>
On Čt, 2016-01-14 at 12:52 -0500, Frediano Ziglio wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> On Thu, 2016-01-14 at 12:07 -0500, Frediano Ziglio wrote:</FONT>
<FONT COLOR="#737373">> > > </FONT>
<FONT COLOR="#737373">> > > On Thu, Jan 14, 2016 at 10:27:02AM -0500, Frediano Ziglio wrote:</FONT>
<FONT COLOR="#737373">> > > > Had a small discussion with Pavel.</FONT>
<FONT COLOR="#737373">> > > > We agree that original code is quite complicated and is hard to</FONT>
<FONT COLOR="#737373">> > > > understand</FONT>
<FONT COLOR="#737373">> > > > the final compression format used.</FONT>
<FONT COLOR="#737373">> > > > </FONT>
<FONT COLOR="#737373">> > > > So we would like to have some public discussion about the topic.</FONT>
<FONT COLOR="#737373">> > > > </FONT>
<FONT COLOR="#737373">> > > > I personally agree we should have a single code deciding the</FONT>
<FONT COLOR="#737373">> > > > compression</FONT>
<FONT COLOR="#737373">> > > > to use.</FONT>
<FONT COLOR="#737373">> > > </FONT>
<FONT COLOR="#737373">> > > I definitely agree here. For one, having different compression being</FONT>
<FONT COLOR="#737373">> > > used depending on whether the qxl driver is used or not is unexpected</FONT>
<FONT COLOR="#737373">> > > (eg if you set image compression to glz, lz will still be used during</FONT>
<FONT COLOR="#737373">> > > initial bootup, and then will 'switch' to glz later on. I haven't looked</FONT>
<FONT COLOR="#737373">> > > at the code, so there might be good reasons for that).</FONT>
<FONT COLOR="#737373">> > > </FONT>
<FONT COLOR="#737373">> > > > </FONT>
<FONT COLOR="#737373">> > > > This is the list of actual compressions:</FONT>
<FONT COLOR="#737373">> > > > - AUTO_GLZ;</FONT>
<FONT COLOR="#737373">> > > > - AUTO_LZ;</FONT>
<FONT COLOR="#737373">> > > > - QUIC;</FONT>
<FONT COLOR="#737373">> > > > - GLZ;</FONT>
<FONT COLOR="#737373">> > > > - LZ;</FONT>
<FONT COLOR="#737373">> > > > - LZ4.</FONT>
<FONT COLOR="#737373">> > > > A client can also decide to disable compression.</FONT>
<FONT COLOR="#737373">> > > > </FONT>
<FONT COLOR="#737373">> > > > The AUTO_XXX looks like they should use QUIC as a fallback if XXX is</FONT>
<FONT COLOR="#737373">> > > > not</FONT>
<FONT COLOR="#737373">> > > > possible or if an image with high graduality is detected.</FONT>
<FONT COLOR="#737373">> > > </FONT>
<FONT COLOR="#737373">> > > (side question, do we have numbers on compression ratio and cpu usage</FONT>
<FONT COLOR="#737373">> > > for quic/lz/glz/lz4?)</FONT>
<FONT COLOR="#737373">> > > </FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > Brief and raw of a Windows replay capture</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> >         Images  MB before   MB after  Ratio     CPU time</FONT>
<FONT COLOR="#737373">> > LZ4     193     24.21       2.43      10.04%    0.04</FONT>
<FONT COLOR="#737373">> > QUIC    204     23.11       1.66       7.18%    0.44</FONT>
<FONT COLOR="#737373">> > GLZ     190     20.05       1.2        5.99%    0.14</FONT>
<FONT COLOR="#737373">> > LZ      202     20.42       2.04       9.99%    0.15</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > So why use Quic ?</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Interesting data. Indeed, QUIC seems to be the worst choice. from this data,</FONT>
<FONT COLOR="#737373">> it</FONT>
<FONT COLOR="#737373">> seems that you'd want GLZ if you were optimizing for network bandwidth, and</FONT>
<FONT COLOR="#737373">> LZ4</FONT>
<FONT COLOR="#737373">> if you're optimizing for CPU usage. Might be nice to see data for a slightly</FONT>
<FONT COLOR="#737373">> larger sample as well.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Out of curiosity, did you write a little utility for doing this benchmark, or</FONT>
<FONT COLOR="#737373">> did you just modify the code in-place?? Having a little benchmark utility</FONT>
<FONT COLOR="#737373">> that</FONT>
<FONT COLOR="#737373">> you could run on different replay captures might be a useful thing to have in</FONT>
<FONT COLOR="#737373">> the repository...</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Jonathon</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>

No code modification at all. Compile with COMPRESS_STAT enabled, run replay
utility with SPICE_DEBUG_LEVEL=3 set at the end you see a similar table
(I added just ratio with LibreOffice calc).
Oh... you just need to use -C replay option with
- 4 quic
- 5 glz
- 6 lz
- 7 lz4
(not sure about 5/6, maybe swapped).
</PRE>
</BLOCKQUOTE>
<BR>
would you mind running with no compression so that we can get CPU baseline? FWIW I've put inverted numbers to a chart (1/cpu time, orig_size/compressed_size, so that greater number is better) and the result is here:<BR>
<IMG SRC="cid:1453479602.21731.22.camel@redhat.com" ALIGN="bottom" BORDER="0"><BR>
You can imagine the numbers as a number of VMs you can squeeze into a single host given a cpu/network constraint.<BR>
<BR>
I was wondering, if the current code is indeed messy if it couldn't be replaced with an adaptive algorithm e.g. starting with some "middle ground" algorithm (LZ4 looks like the candidate) and move up if server detects packet loss or move right if server can't compress images fast enough...<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
I think would be really helpful to collect different replay captures of
normal day job.
</PRE>
</BLOCKQUOTE>
<BR>
IIRC VDI benchmark could be the tool to get such a capture.<BR>
<BR>
David<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
Frediano
_______________________________________________
Spice-devel mailing list
<A HREF="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</A>
<A HREF="http://lists.freedesktop.org/mailman/listinfo/spice-devel">http://lists.freedesktop.org/mailman/listinfo/spice-devel</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>