<br><font size=2 face="sans-serif">OK, I think this explains quite a bit, because even the uncompressed bandwidth usage (200kb in 24 hours) is essentially negligible. At this rate any appreciable amount of server bandwidth would have the capacity for many millions of connections, and other factors (such as kernel limitations, XML parsing, memory constraints) will limit server capacity long before bandwidth becomes an issue. Therefore, adding compression in a heavily strained server will actually decrease its capacity, because internal resources (such as CPU time and memory) will be taken away to save bandwidth, which is plentiful.</font>
<br>
<br><font size=2 face="sans-serif">From the cost perspective, at this rate of transfer, the cost for bandwidth per user is also negligible. Consider that if bandwidth costs $10/GB (this is a number from a web hosting provider, and is probably much higher than one pays for an actual pipe), then supporting one million concurrent users each transferring 200kb in 24 hours costs $2,000 or 0.2 cents per user. Certainly this figure decreases if your bandwidth usage decreases, but either number is negligible when compared to the secondary costs of supporting that many users.</font>
<br>
<br><font size=2 face="sans-serif">The questions, then, are: (1) under what conditions is the bandwidth usage for a client connection non-negligible? and (2) can you achieve the same high compression ratios under these conditions?</font>
<br>
<br><font size=2 face="sans-serif">I hypothesize that the answer to question (1) will imply that the data being exchanged with the client is very non-repetitive and thus non-compressible compared to the 200kb that crossed in 24 hours, and so the answer to (2) will be no. But I will have to look into it further.</font>
<br>
<br><font size=2 face="sans-serif">-Mike</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Michael F. March" <march@indirect.com></b></font>
<br><font size=1 face="sans-serif">Sent by: jdev-admin@jabber.org</font>
<p><font size=1 face="sans-serif">01/06/2002 02:13 PM</font>
<br><font size=1 face="sans-serif">Please respond to jdev</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: <jdev@jabber.org></font>
<br><font size=1 face="sans-serif"> cc: </font>
<br><font size=1 face="sans-serif"> Subject: Re: [JDEV] GZipping Jabber Messages</font>
<br>
<br><font size=1 face="Arial"> </font></table>
<br>
<br><font size=2 face="Courier New">More info:<br>
<br>
I captured XML from a 24 hr Jabber session and the XML from<br>
that session was 179601 bytes and it compressed down to<br>
6966 bytes.<br>
<br>
<br>
<br>
><br>
> I was port forwarding a Jabber session...<br>
><br>
><br>
> > What is the nature of the data you are transferring?<br>
> ><br>
> ><br>
> > After doing a longer session (about 20 minutes), I am getting<br>
> > about 80% in both directions now..<br>
> ><br>
> > > Doing compression with SSH I am getting about 70% compression<br>
> > > outbound and 80% compression inbound..<br>
> > ><br>
> > > I have not investigated how OpenSSH implements compression on<br>
> > > the TCP stream though so I am not sure how great of gauge this<br>
> > > is..<br>
> > ><br>
> > > > Update. I am finding that you can get better compression ratios, up<br>
to<br>
> > > > around 57%, by maintaining the LZ dictionary between packets. Also<br>
> this<br>
> > > > reduces the processor hit asymptotically (but still quite nonzero)<br>
> with<br>
> > > > more packets sent along.<br>
> > > ><br>
> > > > This technique raises still other problems, though, most notably<br>
> > > > reliability. For this to work the gzip deflater on one end and the<br>
> > > inflater<br>
> > > > on the other end must remain exactly in sync for the duration of the<br>
> > > > connection (hours, days, ...). An error in the compressed stream<br>
would<br>
> > be<br>
> > > > magnified many times over in the inflated stream. So for reliability<br>
> > you<br>
> > > > had better hash or at least checksum all the data going across. That<br>
> > means<br>
> > > > you have to have an envelope format.<br>
> > > ><br>
> > > > So for bandwidth and processor usage, this does a lot better than I<br>
> > > > expected compared to my original run, but now we are just a few<br>
steps<br>
> > away<br>
> > > > (credential verification, key exchange, and stream encryption) from<br>
> > > > re-doing SSL.<br>
> > > ><br>
> > > > -Mike<br>
> > > ><br>
> > > > ----- Forwarded by Michael F Lin/Cambridge/IBM on 01/05/2002 11:38<br>
> > > AM -----<br>
> > > ><br>
> > > > Michael F Lin<br>
> > > > To:<br>
> jdev@jabber.org<br>
> > > > 01/04/2002 09:26 cc:<br>
> > > > PM From: Michael F<br>
> > > Lin/Cambridge/IBM@IBMUS<br>
> > > > Subject: Re: [JDEV]<br>
> > > GZipping Jabber Messages(Document link: Michael Lin)<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > Hi Adam, I looked over some of the DotGNU mailing list archives at<br>
the<br>
> > > > discussion you are referring to.<br>
> > > ><br>
> > > > One person from DotGNU says<br>
> > > > ---<br>
> > > > At the end of the day, it is easier to just gzip it and forget about<br>
> > > > the problem. No data loss, and roughly the same level of<br>
> > > > compaction. Highly redundant data like XML compresses<br>
> > > > very well. For example, the 6 Mb All.xml file for the C#<br>
> > > > library specification compresses to ~630k using gzip: about<br>
> > > > 10% of the original size.</font>
<br><font size=2 face="Courier New">> > > > ---<br>
> > > > I believe this is misleading in the context of realtime XML streams<br>
> > (e.g.<br>
> > > > Jabber; SOAP; presumably, whatever DotGNU will use) because you are<br>
> not<br>
> > > > compressing 6Mb of data at once. Rather you are compressing small<br>
> > packets,<br>
> > > > a few hundred bytes in length in the case of Jabber, and then<br>
> > transmitting<br>
> > > > them individually. I ran some tests to see how gzip performs under<br>
> > these<br>
> > > > conditions.<br>
> > > ><br>
> > > > I wrote a program which generates random Jabber <message/> packets.<br>
> The<br>
> > > > body of each message is formed by randomly selecting between 1 and<br>
25<br>
> > > words<br>
> > > > from a 10,000-word English language dictionary file. For each test<br>
> > vector,<br>
> > > > the program runs zlib compress, level 9, on it (equivalent [I think]<br>
> to<br>
> > > > gzip with maximum compression), then records the compressed size and<br>
> > the<br>
> > > > original size. It repeats this until at least 1 million bytes of<br>
> > > > uncompressed data has been processed.<br>
> > > ><br>
> > > > The results from about a dozen runs of this program are very<br>
> > consistent:<br>
> > a<br>
> > > > compression ratio of 17% in 7 seconds of runtime. A typical result<br>
is<br>
> > > > 1,000,011 total bytes of raw data; 830,654 bytes of compressed data.<br>
> > > ><br>
> > > > If I comment the code to compress the test vectors, and leave the<br>
code<br>
> > to<br>
> > > > generate the test vectors, the program runs in less than 1 second.<br>
> > > ><br>
> > > > [This was run on]<br>
> > > > athena% uname -a<br>
> > > > SunOS department-of-alchemy.mit.edu 5.8 Generic_108528-08 sun4u<br>
sparc<br>
> > > > SUNW,Ultra-60<br>
> > > > athena%<br>
> > > ><br>
> > > > Obviously these are preliminary and nonscientific results only, and<br>
> > there<br>
> > > > are other factors to consider with Jabber, such as the likelihood<br>
> > > > previously mentioned that the XML processing is going to be the<br>
> > limiting<br>
> > > > factor in processor time. I find the topic quite interesting,<br>
however,<br>
> > so<br>
> > > I<br>
> > > > am going to fiddle around with it over the next few days and see if<br>
I<br>
> > can<br>
> > > > get it to do better with custom deflate dictionaries and such.<br>
> > Hopefully<br>
> > I<br>
> > > > will even find time to write something on the topic and post it with<br>
> my<br>
> > > > source code. However, based on these initial results I am very wary<br>
of<br>
> > > > gzipping instant messaging XML because of the apparent high<br>
processing<br>
> > > cost<br>
> > > > and mediocre compression ratio. I will continue to test but my<br>
> > hypothesis<br>
> > > > is that gzip or any generic compression algorithm is going to be<br>
very<br>
> > > > mediocre for Jabber as instant messaging.<br>
> > > ><br>
> > > > -Mike<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > Adam Theo<br>
> > > > <adamtheo@theoret To: jdev<br>
> > > <jdev@jabber.org><br>
> > > > ic.com> cc:<br>
> > > > Sent by: Subject: [JDEV]<br>
> > GZipping<br>
> > > Jabber Messages<br>
> > > > jdev-admin@jabber<br>
> > > > .org<br>
> > > ><br>
> > > ><br>
> > > > 01/04/2002 03:32<br>
> > > > PM<br>
> > > > Please respond to<br>
> > > > jdev<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > Hi, all. There's a good discussion going on over at the DotGNU<br>
> > Developer<br>
> > > > list about gzip'ing the XML that is transmitted around on the DotGNU<br>
> > > > platform.<br>
> > > ><br>
> > > > Was wondering if it would be possible to incorporate the same thing<br>
> for<br>
> > > > future versions of the Jabber server? Is it feasible, anyway? They<br>
are<br>
> > > > saying the trade-offs for extra resource consumption would not be<br>
bad<br>
> > at<br>
> > > > all if designed into the server properly, and would reduce bandwidth<br>
> > > > very dramatically (like by 80%, i think). This would be useful for<br>
> > > > high-volume servers with enough processing power, i think...<br>
> > > > --<br>
> > > > /\ -- Adam Theo, Age 22, Tallahassee FL USA --<br>
> > > > //\\ Theoretic Solutions (http://www.theoretic.com)<br>
> > > > /____\ "Software, Internet Services and Advocacy"<br>
> > > > /--||--\ Personal Website (http://www.theoretic.com/adamtheo)<br>
> > > > || Jabber Open IM (http://www.jabber.org)<br>
> > > > || Email & Jabber: adamtheo@theoretic.com<br>
> > > > || AIM: AdamTheo2000 ICQ: 3617306 Y!: AdamTheo2<br>
> > > > "A free-market socialist computer geek patriotic American<br>
buddhist."<br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > jdev mailing list<br>
> > > > jdev@jabber.org<br>
> > > > http://mailman.jabber.org/listinfo/jdev<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > jdev mailing list<br>
> > > > jdev@jabber.org<br>
> > > > http://mailman.jabber.org/listinfo/jdev<br>
> > ><br>
> ><br>
> > _______________________________________________<br>
> > jdev mailing list<br>
> > jdev@jabber.org<br>
> > http://mailman.jabber.org/listinfo/jdev<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > jdev mailing list<br>
> > jdev@jabber.org<br>
> > http://mailman.jabber.org/listinfo/jdev<br>
><br>
> _______________________________________________<br>
> jdev mailing list<br>
> jdev@jabber.org<br>
> http://mailman.jabber.org/listinfo/jdev<br>
<br>
_______________________________________________<br>
jdev mailing list<br>
jdev@jabber.org<br>
http://mailman.jabber.org/listinfo/jdev<br>
</font>
<br>
<br>