ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Client connection from Oracle to IBM MQ is very slow

Post new topic  Reply to topic Goto page Previous  1, 2
 Client connection from Oracle to IBM MQ is very slow « View previous topic :: View next topic » 
Author Message
hughson
PostPosted: Tue May 21, 2019 6:29 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

I suspect @fjb_saper was suggesting that ReverseDNS lookup could be the thing taking the time.

Try turning it off with the following command to see whether this makes any difference.

Code:
ALTER QMGR REVDNS(DISABLED)


Did you get anywhere with trace?

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
modulo2
PostPosted: Wed May 22, 2019 11:14 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I believe the tracing will lead to know the issue, I'm working on it trying to get it working.
_________________
Thanks
Back to top
View user's profile Send private message
modulo2
PostPosted: Thu May 23, 2019 5:44 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I have opened service request in Oracle support trying to enable the log, and provided step by step guide for reproducing the issue, I'm waiting for their reply.


I have done another test on my environment ( multiple calls to the send and forget ), I find that only the first call takes long time of 40 secs, the remaining calls in milliseconds. Does this indicate something regarding Connection pool?

The problem is that from Linux level it doesn't takes that time at all, and previous release of IBM MQ v7 never behaved like this.
_________________
Thanks
Back to top
View user's profile Send private message
modulo2
PostPosted: Mon May 27, 2019 2:18 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

More updates & I really appreciate help

Oracle JVM always runs with a security manager, so after reading this article that is mentioned how to enable Logging in Oracle JVM https://docs.oracle.com/database/121/JJDEV/chtwo.htm#JJDEV02043

I have added java.util.logging.* to my (2) Java Stored procedure and Oracle was able to log my entries in files based on my specification, but IBM MQ java classes were not able to do so

After some investigation, I found this article from IBM v9.1.x ( Not v9.x )
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q030650_.htm

Please scroll down the page till the yellow Important notice
Quote:
The IBM MQ classes for Java trace facility requires further permissions as it performs additional querying of system properties, and also further file system operations.

A suitable template security policy file for running under a security manager with tracing enabled is provided in the samples/wmqjava directory of the IBM MQ installation as example.security.policy.


I can't get this file to know the permission required, does anyone have such files or direction to enable MQ trace under the Java Security Manager ?
_________________
Thanks
Back to top
View user's profile Send private message
hughson
PostPosted: Mon May 27, 2019 9:50 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

modulo2 wrote:
After some investigation, I found this article from IBM v9.1.x ( Not v9.x )
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q030650_.htm

Please scroll down the page till the yellow Important notice
Quote:
The IBM MQ classes for Java trace facility requires further permissions as it performs additional querying of system properties, and also further file system operations.

A suitable template security policy file for running under a security manager with tracing enabled is provided in the samples/wmqjava directory of the IBM MQ installation as example.security.policy.


I can't get this file to know the permission required, does anyone have such files or direction to enable MQ trace under the Java Security Manager ?

I just installed MQ V9.1.1 on an Intel Linux machine and I do not see any such file. Also couldn't find it on Windows.

Anyone else got it?

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Tue May 28, 2019 12:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

only found 2 policy files. in jre/lib/security...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
modulo2
PostPosted: Tue May 28, 2019 1:24 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I have opened a service request with IBM to get the details of this link.

But actually guys, I'm getting support & understanding from you far better than either official IBM or Oracle support

Returning back to original question, the delay that is caused, it seems because of connection pool as it is clear when I initiate the first call it takes very loing time while remaining calls executes in only 2millisecond each.

Let me clarify,
As example I have like a PL/SQL job looping on table ( lets say contains 100 records ) that I need to send corresponding 100 MQ messages, only the first call takes very long time ( 41 secs ) but the remaining 99 calls everyone takes 2 millisecond each.

Is there a way to optimize the connection pool from Java code? Or is there any ideas what might be the issue?
_________________
Thanks
Back to top
View user's profile Send private message
hughson
PostPosted: Tue May 28, 2019 12:00 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

modulo2 wrote:
Or is there any ideas what might be the issue?

As I suggested in an earlier reply, the length of the delay sounds like a network timeout - 20 seconds is a common TCP connect timeout.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
modulo2
PostPosted: Tue May 28, 2019 12:04 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

Sorry, maybe I missed this post.

Can you please elaborate more about this timeout? On which level on the network itself or specified in the client?

Appreciate more details.
_________________
Thanks
Back to top
View user's profile Send private message
hughson
PostPosted: Tue May 28, 2019 12:09 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

It's the default value for the TCP level timeout on the socket. The fact that after this timeout you don't fail to connect suggests that your connection is able to try somewhere else which then succeeds, hence my original guess about comma-separated connames before you gave us any information about your set up.

It's still just a guess though. Trace would help rule it in or out.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
modulo2
PostPosted: Tue May 28, 2019 12:17 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I think if it reaches 41 seconds without throwing exception, it means it didn't start establishing the connection and the time is spent in something else.

My guess is more to memory and resources consumed in establishing connection pool, as this justifies the remaining calls executes in 2 milliseconds.

I had a talk with IBM account manager, because of long delay in replying to service request, and he requested me to raise the severity to 1.

I will try it just when I reach work at least to get the permission for the MQ trace.

Reaslly thanks for your help
_________________
Thanks
Back to top
View user's profile Send private message
modulo2
PostPosted: Wed May 29, 2019 5:47 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I think my guess was right & the problem is from Connection Pool.

I have read this section in IBM documentation https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q031110_.htm

And I applied code changes to use MQSimpleConnectionManager and pass it to QueueManager while creation, so I changed my code to be similar to https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q031140_.htm

The whole delay is happening in the line
Code:
MQSimpleConnectionManager myConnMan=new MQSimpleConnectionManager();


Remaining lines of creation of QueueManager doesn't consume any time.

Is there a way to disable the connection pooling with code?
_________________
Thanks
Back to top
View user's profile Send private message
modulo2
PostPosted: Mon Jun 03, 2019 4:10 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

Thanks God, It is working now First connection takes 2 seconds and remaining connections in same session in milliseconds.

Once the MQ trace or logs appeared in console, lots has been unvieled, and problem was determined and solved. It took IBM service request severity 1 to get intouch with Level 3 support who guided me to alternatives to MQ trace.

Below are the details:
First the link for permission of v9.1.2 important note has wrong documentation and they will solve it. https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q030650_.htm

The actual permissions that is required to write to logs should be by two permissions(As per the L3 support) as follows:
Code:
permission java.io.FilePermission "/xyz/log","read,write";
permission java.io.FilePermission "/xyz/log/*","read,write";


This also didn't work for me & I will tell you now shortly:
They provided another system property that write to environment log file which solved the issue, as it written to Oracle trace files where I could know what was the issue. The system property is
Code:
com.ibm.msg.client.commonservices.trace.startup=true


When I found the traces in the Oracle trace file, I found ClassNotFoundException then when traced, it needs jms.jar, provider.jar, fscontext.jar as well to the relocatable jars, when I added these jars as well I still got dependency on JSON objects from IBM that was not in the CD of IBM MQ as well

After contacting them again, they told me they are aware of the issue and solved this in later releases to 9.0.0.4 (Which I was using), and it is better for me to upgarde to v9.1.2 client, I have done the upgrade to 9.1.2 and updated the jar files accordingly (They are all mentioned in allclient.jar manifest file classpath) I found different dependency to org.json.jar than previous IBM json.

Anyway, I did all the imports and everything is fine now.

Regarding the MQ trace was not being generated also appeard from Oracle traces, it is because NumberFormatException was thrown when trying to parse the PID, as I found Oracle passses it in something like this "PID=1234&SID=FIS2" that's why it was always throwing this exception.

Thanks very much for your support during the last period, you were very helpful in guiding me to know the issue
_________________
Thanks
Back to top
View user's profile Send private message
hughson
PostPosted: Mon Jun 03, 2019 8:27 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

I am happy to hear that you were able to get traces successfully (that's always useful!) and that you also got to the bottom of the issue.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Client connection from Oracle to IBM MQ is very slow
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.