23.07.2013 Views

O'Reilly - Java Message Service

O'Reilly - Java Message Service

O'Reilly - Java Message Service

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Java</strong> <strong>Message</strong> <strong>Service</strong><br />

• The amount of data to be processed through the messaging system over a given<br />

period of time. This can be measured in messages per second, bytes per second,<br />

messages per month, etc.<br />

• The typical size of the messages being processed. Performance data will vary<br />

depending on the message size.<br />

• Any atypical message sizes being produced. If 90% of the messages being<br />

processed through the system are 100 bytes in size, and the other 10% are 10<br />

megabytes, it would be important to know how well the system can handle either<br />

scenario.<br />

• The messaging domain to be used, and how it will be used. Does the entire<br />

application use one p2p queue? Are there many queues? Is it pub/sub with 1,000<br />

topics? One-to-many, many-to-one, or many-to-many?<br />

• The message delivery modes to be used. Persistent? Nonpersistent? Durable<br />

subscribers? Transacted messages? A mixture? What is the mixture?<br />

7.1.2 Testing the Real-World Scenario<br />

Any vendor can make any software product run faster, provided the company has the right<br />

amount of time, proper staffing, commitment, and enough hardware to analyze and test a<br />

real-world deployment environment.<br />

The simplest scenario for a vendor to optimize is the fastest performance throughput<br />

possible with one or two clients connected. This is also the easiest scenario to test, but is<br />

not the kind of testing we recommend; for one thing, it's difficult to imagine a realistic<br />

application that only has one or two clients. More complex testing scenarios that better<br />

match your system's real-world environment are preferable.<br />

It is important to know ahead of time if the vendor you have chosen will support the<br />

requirements of your application when it is deployed. Because JMS is a standard, you may<br />

switch JMS vendors at any time. However, you may soon find yourself building vendorspecific<br />

extensions and configurations into your application. It's always possible to change<br />

vendors, if you're willing to expend some effort. However, if you wait to find out whether<br />

or not your application scales, you may no longer be able to afford the time to switch to<br />

another vendor.<br />

This is not intended to imply that using JMS is a risky proposition. These same issues<br />

apply to any distributed infrastructure, whether third-party or home-grown, whether it is<br />

based on a MOM or based on CORBA, COM, EJB, or RMI, and whether it is based on an<br />

established vendor or an emerging one. Everything should be sized and tested prior to<br />

deployment.<br />

7.1.2.1 Testing with one client<br />

The most important thing to realize is this:<br />

performanceWithOneClient != performanceWithManyClients;<br />

Many issues come into play once a message server starts to scale up to a large number of<br />

clients. New bottlenecks appear under heavy load that would never have occurred<br />

otherwise. Examples include thread contention, overuse of object allocation, garbage<br />

collection, and overflow of shared internal buffers and queues.<br />

109

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!