JDBC Thin Driver Performance Problem on AIX
319804Apr 12 2005 — edited Jun 2 2006Dear all,
We experienced a very slow performance in our java program running on an AIX machine. We narrowed down our investigation to JDBC call in the java program. We created a program that open a database connection using thin driver, create a prepared statement, and execute a query. The program does timing when it opens the connection and executes the query. We ran the program in both the AIX machine and a laptop, connecting to a same database from the same network, and compare their results. The AIX machine takes a much longer time compare to the laptop, about 35 - 50 times slower than the laptop. My questions:
- Has anybody ever encountered and resolved this problem before?
- What could possibly caused this slow performance in AIX?
- Is Oracle JDBC Thin driver optimized for AIX machine?
Any helps would be greatly appreciated. Thanks a lot.
Best Regards,
Edison
=====
PS: Here are some details on our investigation:
The AIX machine has the following specs:
- AIX5.1 ML03
- IBM EServer pSeries 630
- 4GB RAM
- JDK 1.3.1 from BEA Weblogic Server 6.1 SP4 for AIX
- Using classes12.jar from Oracle Client 9.2.0.1.0
The laptop has the following specs:
- Windows XP Professional SP2
- Intel Pentium M 1.5GHz
- 1GB RAM
- JDK 1.3.1 from BEA Weblogic Server 6.1 SP4 for Windows
- Using classes12.jar from Oracle Client 9.2.0.1.0
The snapshot of the program:
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
OracleDriver driver = new OracleDriver();
long s = System.currentTimeMillis();
conn = DriverManager.getConnection("jdbc:oracle:thin:@172.18.22.93:1521:wmss", "xxxxx", "xxxxx");
System.out.println("Connection Time = " + (System.currentTimeMillis() - s));
stmt = conn.prepareStatement("select entityid from wm_r_cust where idnumber='S0273724H' and idtypeid='673' and idissuerid='350' and status='A' order by cifnumber desc, dtupdated desc, dtcreated desc");
for (int i=0; i<5; i++) {
long start = System.currentTimeMillis();
rs = stmt.executeQuery();
System.out.println("Execution Time = " + (System.currentTimeMillis() - start));
if (rs.next()) {
System.out.println("Result = " + rs.getString(1));
} else {
System.out.println("Result = <none>");
}
try { rs.close(); } catch (Exception e) {}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try { rs.close(); } catch (Exception e) {}
try { stmt.close(); } catch (Exception e) {}
try { conn.close(); } catch (Exception e) {}
}
The output in AIX machine:
Connection Time = 965
Execution Time = 366
Result = 91163
Execution Time = 1
Result = 91163
Execution Time = 0
Result = 91163
Execution Time = 0
Result = 91163
Execution Time = 0
Result = 91163
The output in the laptop:
Connection Time = 370
Execution Time = 0
Result = 91163
Execution Time = 10
Result = 91163
Execution Time = 0
Result = 91163
Execution Time = 0
Result = 91163
Execution Time = 0
Result = 91163
The program was executed a couple of times in both machines and show consistent results.