Author |
Message
|
jwendorf |
Posted: Mon Jul 02, 2007 7:32 am Post subject: Performance with messages greater than 4MB |
|
|
Acolyte
Joined: 15 May 2001 Posts: 63 Location: Madison, WI
|
We have an application that is writing large jpeg messages to a queue, 2mb and larger.
Writing to the queue performs really well, but the get takes sometimes 14 seconds or longer to complete.
We have looked at the log set up for the queue manager and the placement on separate dasd and can not come up with anything. Has
anyone had experience with this?
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 02, 2007 7:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What language? Which MQ API? How much memory does the receiving application have? How is the receiving application receiving the message? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 02, 2007 7:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
And what platform? What version / patch level of MQ? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jwendorf |
Posted: Mon Jul 02, 2007 8:05 am Post subject: Performance with messages greater than 4MB |
|
|
Acolyte
Joined: 15 May 2001 Posts: 63 Location: Madison, WI
|
This is on a Windows 2003 server with service pack 1 and is running Websphere MQ v6.0.2.1. The application is written in Java and is using the MQ classes. |
|
Back to top |
|
 |
jwendorf |
Posted: Tue Jul 03, 2007 7:52 am Post subject: Performance with messages greater than 4MB |
|
|
Acolyte
Joined: 15 May 2001 Posts: 63 Location: Madison, WI
|
The test has been run with large and small heap sizes and the results have been the same. The developer has provided the code for the MQget:
package com.amfam.ecfuploader.batch;
import com.amfam.ecfuploader.business.ECFUploaderContext;
import com.amfam.ecfuploader.util.ECFMQUtil;
import com.ibm.mq.MQMessage;
/**
* @author tlw021
*
*/
public class TestRead {
public static void main(String[] args) {
System.out.println("Reading queue messages ");
try {
ECFUploaderContext.configure(new String[] { "com/amfam/ecfuploader/batch/batchConfig.xml" });
} catch (Exception e) {
System.out.println("Unable to configure spring" + e.getMessage());
e.printStackTrace();
}
// Kick off the request
int count = 0;
ECFMQUtil ecfMQUtil = (ECFMQUtil) ECFUploaderContext.getBean("ecfUploader.ECFMQUtil");
try {
long beginTime = System.currentTimeMillis();
int numMsgs = ecfMQUtil.queueDepth();
System.out.println("Messages in queue = " + numMsgs);
System.out.println("Time to retreive queue depth:" + (System.currentTimeMillis() - beginTime) + " milliseconds");
for (int i = 0; i < numMsgs; i++) {
// need to retrieve from spring singleton="false" - MQ session data is rememebered
ecfMQUtil = (ECFMQUtil) ECFUploaderContext.getBean("ecfUploader.ECFMQUtil");
try {
beginTime = System.currentTimeMillis();
MQMessage msg = ecfMQUtil.getQueueMessage();
// message may have been read by another process
if (msg != null) {
System.out.println("Time to get message:" + (System.currentTimeMillis() - beginTime)+ " milliseconds");
System.out.println("Message Type = " + msg.messageType);
System.out.println("Message Length = " + msg.getMessageLength() + "\n");
} else {
System.out.println("only read " + count + " message even though queue depth was " + numMsgs);
break;
}
} finally {
try {
ecfMQUtil.getClose(true);
} catch (Exception e) {
// ignore
System.out.println("unable to close/commit get Message");
}
}
count++;
}
} catch (Exception e) {
System.out.println("Error occured reading messages. " + e.getMessage());
e.printStackTrace();
}
System.out.println("Read " + count + " messages.");
}
} |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 03, 2007 7:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Gosh, what a horribly written program.
DO NOT do
Code: |
int numMsgs = ecfMQUtil.queueDepth();
for (int i = 0; i < numMsgs; i++) { |
ESPECIALLY when you're GETTING messages. _________________ I am *not* the model of the modern major general.
Last edited by jefflowrey on Tue Jul 03, 2007 10:35 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 03, 2007 10:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
Gosh, what a horribly written program.
|
I'd second that. That's a terrible way of doing it. Look at some of the sample code for better ways.
How does the ecfMQUtil class handle connections? Does the method getQueueMessage connect each time it trys to get a message? That'll kill your performance stone dead. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|