X-Received: by 10.66.89.135 with SMTP id bo7mr6299471pab.16.1356713044924; Fri, 28 Dec 2012 08:44:04 -0800 (PST) Received: by 10.49.24.164 with SMTP id v4mr5255608qef.6.1356713044514; Fri, 28 Dec 2012 08:44:04 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!f6no8991922pbd.1!news-out.google.com!6ni68200pbd.1!nntp.google.com!f6no8991915pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Fri, 28 Dec 2012 08:44:04 -0800 (PST) In-Reply-To: <50ddbfe6$0$281$14726298@news.sunsite.dk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=137.100.97.30; posting-account=LYoTOgoAAABkuGLLOGXg_LiQpwWAp52F NNTP-Posting-Host: 137.100.97.30 References: <94fcfac6-eff5-4e84-956a-8a7970867867@googlegroups.com> <50ddbfe6$0$281$14726298@news.sunsite.dk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1e5259b0-df4a-4bf3-be7e-0775eb3ebfc5@googlegroups.com> Subject: Re: JMS vs Sockets -- bandwidth, size, speed, etc. From: me2 Injection-Date: Fri, 28 Dec 2012 16:44:04 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.java.programmer:20763 On Friday, December 28, 2012 10:50:54 AM UTC-5, Arne Vajh=F8j wrote: > On 12/28/2012 10:25 AM, me2 wrote: >=20 > > I think that I didn't phrase my question well enough. There are two >=20 > > metrics that I am curious about--bandwidth usage and speed. For X >=20 > > messages of N length (assume a constant size) going to each of Y >=20 > > consumers (so, X * Y messages total), what is the comparison? I can >=20 > > test the speed and so far, the sockets seem to win as long as there >=20 > > are not a lot of consumers (otherwise the threading seems to choke >=20 > > it). That leaves the bandwidth question--how much larger (if any) is >=20 > > a JMS message on the wire vs in a socket. I would hazard (as a >=20 > > newbie) that the socket is smaller--you don't have wrappers or >=20 > > envelopes or meta data but instead just the data. So how much larger >=20 > > is the JMS message? >=20 >=20 >=20 > Why do you think speed and bandwidth are the most important >=20 > criteria for deciding between sockets and JMS? I have never >=20 > seen that choice made for only performance reasons. >=20 >=20 >=20 > JMS is just an API, so JMS does not have a specific size overhead. >=20 > Each implementation will have different size overhead. >=20 >=20 >=20 > And if the socket code is slower than the JMS code for large number >=20 > of consumers then that only means that the socket code is not >=20 > optimal written. >=20 >=20 >=20 > Arne Good morning Arne, The socket code clocked faster when processing 1 consumer and 1 producer th= an my quick throw-together of JMS with 5 consumers and 1 producer. Both se= nt 10 character strings 10,000 times. I'm just getting back into Java, so = I'm sure that the socket programming was not as optimized as it could be--b= ut there was 3 consumers and 1 producer and it still was faster than the 1 = producer/5 consumer JMS setup. The multiple consumers connected to a socke= t/thread setup as illustrated by Oracle in their KnockKnock example--so I'm= not sure how this would scale for 10 consumers, 100 consumers, etc. The bandwidth size is the most important priority because of a number of co= nsiderations--I can't justify using JMS if it uses 10 times the bandwidth--= so I have to figure out how to measure that. The next thing is speed--how = fast can the X number of messages go through. The next priority is maintai= nability and somewhere else down the list is scalability. So that's how it goes. I'm looking at Wireshark but I'm very new to it, so= I am going to have to figure out how that works. Thanks for your point of view, me2