Oracle 连接压缩?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1954279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle connection compression?
提问by joev
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.
我有一个使用 JDBC 连接到 Oracle 11g 的应用程序。不幸的是,运行我的应用程序的机器和 Oracle 机器通过带宽稍低的连接进行连接。我没有嗅探连接,但我很确定通过连接的数据流没有被压缩。对于我的应用程序,我更关心带宽而不是延迟。
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.
有没有办法告诉 JDBC 驱动程序和 Oracle 压缩通过连接的数据?谷歌对数据文件压缩提出了很多答案,但我找不到关于网络协议压缩的任何内容。
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!
我正在使用 Oracle 的瘦驱动程序,但如果这仅由 OCI 驱动程序支持,我可以切换到该驱动程序。感谢您的任何建议!
采纳答案by Adam Hawkes
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.
直接回答这个问题,驱动程序(瘦或 OCI)没有这样的压缩机制。而且由于发送的数据可能是某种时髦的二进制格式,我不确定它是否会通过 SSL 压缩得很好。将需要采用一些其他机制来提高网络性能。
回答by Pablo Santa Cruz
I don't know specifics about Oracle's thin and OCI drivers. But you could use SSHtunnels to achieve compression.
我不知道有关 Oracle 瘦驱动程序和 OCI 驱动程序的具体信息。但是您可以使用SSH隧道来实现压缩。
- So, in your Oracle machine, you setup a SSH daemon. If your Oracle server is running under RedHat Linux, you're done
- 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.
- 因此,在您的 Oracle 机器上,您设置了一个 SSH 守护进程。如果您的 Oracle 服务器在 RedHat Linux 下运行,那么您就完成了
- 在您的客户端计算机(托管通过 JDBC 连接的应用程序的计算机)上设置 SSH 连接,启用压缩隧道。您可以使用命令行 SSH 或Putty(如果您在 Windows 下)来执行此操作。
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.
然后,在您的应用程序中,使用 localhost:1521 作为 Oracle 的地址。
回答by Joshua McKinnon
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?
根据我的经验,使用 Oracle JDBC 驱动程序时,高延迟对性能的影响远远超过低带宽。(至少在我处理的应用程序中)。你说你不担心延迟,但你能估计一下你的低带宽环境的延迟吗?
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.
您发送的数据有多大?是否有 BLOB 列?是否涉及其他技术,例如连接池或 Hibernate?有很多潜在因素,而不仅仅是您的数据是否被压缩。
Have you done any WAN emulation to try to isolate what is degrading your performance most? WANemis pretty easy to setup.
您是否进行了任何 WAN 仿真以尝试隔离最能降低性能的因素? WANem很容易设置。
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.
我已经在这个问题上花费了数周时间,100-200 毫秒的延迟对我们的伤害远远超过 1Mbit 的带宽限制。希望你在另一条船上 - 压缩是一个更容易解决的问题。
回答by Itagyba Abondanza Kuhlmann
Just an Update.
只是一个更新。
Oracle JDBC connections in 12.2 now have compression feature as disclaimed in this post: http://www.oracle.com/technetwork/topics/jdbc-faq-090281.html#0000_00
12.2 中的 Oracle JDBC 连接现在具有压缩功能,如本文所述:http: //www.oracle.com/technetwork/topics/jdbc-faq-090281.html#0000_00
回答by Nirmala
Refer to Oracle JDBC Developer's guidefor enabling the network compression. Note that this is an Oracle12c Release 2 feature.
有关启用网络压缩的信息,请参阅Oracle JDBC 开发人员指南。请注意,这是 Oracle12c 第 2 版的一个特性。