|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Slow MQPUT when multithreading... |
« View previous topic :: View next topic » |
Author |
Message
|
Maximus |
Posted: Tue Feb 17, 2009 7:33 am Post subject: Slow MQPUT when multithreading... |
|
|
Acolyte
Joined: 14 Jun 2004 Posts: 57
|
Hi,
Using:
-JDK 1.5
-MQ JAVA Base API
-MQ Client 5.3
-Server is WMQ 6.0 on z/OS
-Non-persistent messages
-Use only one MQ connection for all the threads
-Open both Queue (request and response) at the beginning of each thread.
-Close both Queue at the end of each thread
If I do MQPUT a 1000 time in a single thread into a queue in a loop it will be very fast.
If I start, say 10 threads and each of them do MQPUT 100 times and after every MQPUT wait for the response. The time for only the MQPUT is fast for the first few put and then slow down for the other MQPUT. I don't take into account the time to wait for the response, only the time for the MQPUT operation. Why is the MQPUT slow in this context?
Any suggestion or help would be appreciated. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 17, 2009 2:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Because using a single connection you are singlethreading both MQPuts and MQgets through that connection. You'll feel a lot more pain with huge messages where the put might take some time. This is why you should have multiple connections as needed. On top of this it is recommended to use syncpoint when using multiple threads to the same queue.
Have fun :innocentc: _________________ MQ & Broker admin |
|
Back to top |
|
 |
Maximus |
Posted: Wed Feb 18, 2009 4:34 am Post subject: |
|
|
Acolyte
Joined: 14 Jun 2004 Posts: 57
|
fjb_saper wrote: |
Because using a single connection you are singlethreading both MQPuts and MQgets through that connection. You'll feel a lot more pain with huge messages where the put might take some time. This is why you should have multiple connections as needed. On top of this it is recommended to use syncpoint when using multiple threads to the same queue.
Have fun :innocentc: |
This is exactly my problem, since I am using one connection for all the threads, the MQI calls where serialized, as explained here:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/fg12070_.htm
"MQI calls using a single shared Hconn are serialized across threads."
When I use one connection per thread I get the result I was expecting.
Best regards. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|