Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

High CPU usage from Java Procedures

Status
Not open for further replies.

nshen

Programmer
May 14, 2002
53
US
Hi! I have several string functions written in JAVA to do substring and indexing which is not available in DB2 SQL.
Now when I monitor the DB2 Server CPU usage, I noticed db2fmp(java) is taking up more than 60% of CPU on a 4-CPU AIX server. The DB2 Server is using JDK 1.3.1.

Questions:
1) Will JDK 1.4 be faster than 1.3.1?
I'm using DB2 V8 fixed pack 4.
2) The JAVA_HEAP_SZ has been increased to 4096. Shall it be increased further?
3) What is your experience of using C procedure verses Java procedure in terms of performance? Shall I rewrite them using C?

Thank you for sharing!
Regards, Nancy



 
Hello Nancy,
did you resolve the described problem ?
We currently encounter a similar problem, also using a java stored procedure
on
db2 8.1 FP 2
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1)
Classic VM (build 1.3.1, J2RE 1.3.1 IBM AIX

AIX 5.1.0.0

Strangely, we did not see the problem on a box with a separate fenced userid, but only on a system that runs fenced processes under the instance owner. (not sure if this may be a reason)
How was your setup ?

Greetings, Markus
 
We ran ours as fenced process too.

We changed the Java UDF into C++ external function and everything is fine now. CPU usage is back to normal and we gained 2 times better performance under normal load and 6 times better performance under heavy multithreaded load tests. This is not surprising since we all know C++ performs better than Java. We do have to generate platform dependent binary library to be put onto DB2 Server directory. But the gain of performance out weights the little inconvenience of copying the binary to every DB2 Server.

Hope you can solve your problem too.
Regards, Nancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top