简体   繁体   中英

MQQueue get method takes too long from remote server

Im trying to read message (approx 1Mb size) from remote queue. Method queue.get(theMessage, gmo) takes about 3-6 seconds to complete. Is there any options (like buffer size) to improve performance?

qMgr = new MQQueueManager(qManager);
            int openOptions = CMQC.MQOO_FAIL_IF_QUIESCING | CMQC.MQOO_INPUT_SHARED | CMQC.MQOO_BROWSE;

            MQQueue queue = qMgr.accessQueue(qQueue, openOptions);

            MQMessage theMessage = new MQMessage();

            //theMessage.messageFlags = CMQC.MQMF_SEGMENTATION_ALLOWED;
            MQGetMessageOptions gmo = new MQGetMessageOptions();
            gmo.options = CMQC.MQGMO_LOGICAL_ORDER | CMQC.MQGMO_ALL_SEGMENTS_AVAILABLE | CMQC.MQGMO_COMPLETE_MSG | CMQC.MQGMO_WAIT | CMQC.MQGMO_BROWSE_FIRST;
            gmo.matchOptions = CMQC.MQMO_NONE;
            gmo.waitInterval = 5000;
            queue.get(theMessage, gmo);

it's hard to give advice without concrete data

the MQGMO_LOGICAL_ORDER can affect performence significntly - I would test if removing it improves perfomence

MQGMO_ALL_SEGMENTS_AVAILABLE appears irrelevant as MQMF_SEGMENTATION_ALLOWED is commented out - but if it's used it can also affect perfomence

try also running trace on the server and \\ or client side to get more insight on what takes so long

Ping to remote server about 100ms. Maybe i need to rewrite my application with multiple threads?

Well, that would explain a lot. Pinging a server should take less than 5ms and approach 1ms. If it takes 100ms, then your network is SLOW, really SLOW.

No amount of programming, except for compression, will solve your issue. And even then compression is no magic bullet.

Go to your network people and ask them what is the network speed between the 2 servers. If they say it is less than 1Gb/s then point out that it is the 21st century and your application requires a minimum of 1Gb/s.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM