views:

293

answers:

3

I have an application that uses JDBC to connect to Oracle 11g. Unfortunately, the machine my app is running on and the Oracle machine are connected via a somewhat low bandwidth connection. I haven't sniffed the connection, but I am pretty sure the data streaming across the connection is not compressed. For my application, I'm more concerned about bandwidth than latency.

Is there any way to tell the JDBC driver and Oracle to compress the data going through the connection? Google comes up with a lot of answers for data file compression, but I couldn't find anything about network protocol compression.

I'm using Oracle's thin driver, but if this is only supported by the OCI driver, I could switch to that. Thanks for any suggestions!

+1  A: 

I don't know specifics about Oracle's thin and OCI drivers. But you could use SSH tunnels to achieve compression.

  1. So, in your Oracle machine, you setup a SSH daemon. If your Oracle server is running under RedHat Linux, you're done
  2. On your client machine (the one that hosts your application that connects through JDBC) setup a SSH connection, enabling a compressed tunnel. You can use command line SSH or Putty (if you are under windows) to do that.

Setup the connection to something like this:

$ ssh -L1521:localhost:1521 username@oracleserver_ip

Then, in your application, use localhost:1521 as Oracle's address.

Pablo Santa Cruz
No, a VPN connection will certainly **not** work. There's a limited amount of bandwidth - adding VPN overhead is going to ensure that *less* actual data is stored per packet.
OMG Ponies
While that is a possibility, I'm hoping to see if the Oracle driver has this built-in, to keep it simple.
joev
This is not a VPN. It's just a tunnel. And it **will** work. If you use a compressed tunnel and what you are trying to transmit can be compressed (like huge amounts of text or XML) it will be compressed.
Pablo Santa Cruz
@joev I know that it will be easier to just have a flag in the driver or a parameter in the URL, but this is all I know. :-) Maybe there's something on URL connection parameters documentation...
Pablo Santa Cruz
SSH is an encrypted tunnel (http://en.wikipedia.org/wiki/Tunneling_protocol) making it a defacto VPN. That said, it could well work, if the compression ratio is good enough to overcome the VPN/tunnel overhead.
DCookie
+2  A: 

In my experience, high latency harms performance using the Oracle JDBC drivers far more than low bandwidth. (at least in the application I work on). You say you aren't worried about latency, but could you give an estimate on the latency of your low-bandwidth environment?

How big is the data you're sending? Are there BLOB columns? Are there other technologies involved, like a connection pool, or Hibernate? There are a lot of potential factors, not just if your data is being compressed.

Have you done any WAN emulation to try to isolate what is degrading your performance most? WANem is pretty easy to setup.

I've spent weeks on this problem, and 100-200ms latency hurt us much more than a 1Mbit bandwidth limitation. Hopefully you are in a different boat - compression an easier problem to solve.

Joshua McKinnon
64 bytes pings are only taking 4ms to be ack-ed, so that's not so bad. No BLOBs, but a lot of INSERT activity. No connection pooling, it's a single connection. Staffing is a little light for the holidays, so I can't get into deep WAN diagnostics for the moment. That seemed like the next obvious thing to look at. But thanks for the pointer to WANem, I'll look into that!
joev
If it's only 4ms, I'm going to say you're right in that latency should play a very minimal role.
Joshua McKinnon
+2  A: 

To directly answer the question, the drivers (thin or OCI) have no such mechanism for compression. And since the data sent is likely in some funky binary format I'm not sure that it will compress well over SSL. Some other mechanism for improving network performance will need to be employed.

Adam Hawkes