简体   繁体   中英

Oracle DB very slow network interaction

I have a problem with my Oracle DB network speed.

First of all, what's the essence of the problem. There are java application on my computer and Oracle DB on a remote server. Connection speed between them is about 2,5MB/s. I execute in my java app a very simple query like "select id, name from table_name", result set contains ~60K rows (size is about 1,5 Mb) and transfers to my app for ~80 seconds. Accordingly to the profiler the most of the time application spends in oracle.net.Packet.recieve method.

For comparison the same query executes in SQL Developer for 0,5-0,7 seconds for 5000 rows. Extrapolating to 60K rows we have about 6-8 seconds.

The result of excution of tcpdump for my application shows that data transfers in chunks with size about 200 bytes. On the other hand for SQL Developer tcpdump shows package size more than 2000 bytes.

Official Oracle documentations suggests to increase SDU and TDU parameters, unfortunately i can't change configuration of database, so i tried to determine them on client side in a such way:

jdbc:oracle:thin:@(DESCRIPTION=(SDU=11280)(TDU=11280)(ADDRESS=(PROTOCOL=tcp)(HOST=<host>)(PORT=1521)(SEND_BUF_SIZE=11784)(RECV_BUF_SIZE=11784))(CONNECT_DATA=(SERVICE_NAME=<db>)))

But this didn't bring any changes. Can database or ojdbc driver ignore this parameters? Or maybe i'm on the wrong way?

As it turned out, the reason was in fetch size. Increasing its value allows to decrease execution time at ~100 times.

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