Session Data Unit

本译文翻译自Net Services Administrator's Guide的第14章Optimizing Performance中对于SDU的介绍。

在一个典型数据库配置中,Oracle Net在通过网络发送数据前将数据按照SDU大小放进缓存。Oracle Net当缓存被填满,flushed或者当应用尝试去读取数据的时候发送。调整有关于Oracle Net发送数据的SDU大小可以优化性能、网络利用率、内存消耗。当大量的数据被传输,增大SDU大小可以优化性能和网络吞吐量。

Oracle Net发送的总数据被称作信息量。Oracle Net默认假定信息大小介于0到8192b,极少比8192b大。如果这个设定是正确的,那么大多数时间,被传送的数据为一个SDU大小。

SDU大小可以介于512-65535间。对于客户端和专用服务的默认SDU大小是8192b。对于共享服务,SDU默认大小是65535b。

实际的SDU大小在连接时取客户端及服务器设置值得最小值。如果使用的不是共享服务,那么配置不同于默认值得SDU需要同时在客户端和服务端设置。对于共享服务模式,因为服务器端默认是最大值,所以只需要设置客户端的值即可。

当分配的信息大小不是8192的时候,就需要考虑修改SDU大小了。SDU大小应该比分配的信息大小大70b。如果分配的信息大小加70b超过了最大SDU设置,那么SDU就需要调整到比每个信息大小大70b。修改默认SDU大小,在sqlnet.ora文件中改变DEFAULT_SDU_SIZE参数值。

例如,如果应用多数发送及接受到的信息小于8k,那么将70b考虑在内,将SDU设置为8k是个不错的选择。如果内存允许,那么可以使用SDU最大值以最小化对于Oracle Net Services的系统调用。

数据库设置SDU大小:
配置文件:
1.sqlnet.ora
设置DEFAULT_SDU_SIZE参数,例如:
DEFAULT_SDU_SIZE=8192
2.初始化参数文件
如果使用共享服务进程,那么在初始化参数文件中设置DISPATCHERS参数值,如下:
DISPATCHERS="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp))(SDU=8192))"
3.listener.ora
如果在listener.ora文件中设置了目标主机的列表,那么在独占服务进程中,该文件中的SID_LIST中的SDU参数值将覆盖在sqlnet.ora文件中的设置值。
SID_LIST_listener_name=
     (SID_LIST=
          (SID_DESC=
            (SDU=8192)
            (SID_NAME=sales)))
在客户端设置SDU值:
1.sqlnet.ora
设置DEFAULT_SDU_SIZE参数,例如:
DEFAULT_SDU_SIZE=8192
2.tnsnames.ora
针对特定的连接,可以在DESCRIPTION中设置SDU参数

name=
(DESCRIPTION=
     (SID=11280)
           (ADDRESS=(PROTOCOL=tcp)(HOST=host_ip)(PORT=1521))
     (CONNECT_DATA=
          (SERVICE_NAME=srv_name))
)

因为怕翻译有问题,下面给出原文:

Configuring Session Data Unit
Under typical database configuration, Oracle Net encapsulates data into buffers the size of the session data unit (SDU) before sending the data across the network. Oracle Net sends each buffer when it is filled, flushed, or when an application tries to read data. Adjusting the size of the SDU buffers relative to the amount of data provided to Oracle Net to send at any one time can improve performance, network utilization, and memory consumption. When large amounts of data are being transmitted, increasing the SDU size can improve performance and network throughput.
The amount of data provided to Oracle Net to send at any one time is referred to as the message size. Oracle Net assumes by default that the message size will normally vary between 0 and 8192 bytes, and infrequently, be larger than 8192 bytes. If this assumption is true, then most of the time, the data is sent using one SDU buffer.
The SDU size can range from 512 bytes to 65535 bytes. The default SDU for the client and a dedicated server is 8192 bytes. The default SDU for a shared server is 65535 bytes.
The actual SDU size used is negotiated between the client and the server at connect time and is the smaller of the client and server values. Configuring an SDU size different from the default requires configuring the SDU on both the client and server computers, unless you are using shared servers. For shared servers, only the client value must be changed because the shared server defaults to the maximum value.
You should consider changing the SDU size when the predominant message size is smaller or larger than 8192. The SDU size should be 70 bytes larger than the predominant message size. If the predominant message size plus 70 bytes exceeds the maximum SDU, then the SDU should be set such that the message size is divided into the smallest number of equal parts where each part is 70 bytes less than the SDU size. To change the default, change the DEFAULT_SDU_SIZE parameter in the sqlnet.ora file. Configuring Session Data Unit 14-2 Oracle Database Net Services Administrator's Guide

For example, if the majority of the messages sent and received by the application are smaller than 8KB, taking into account the 70 bytes for overhead, then setting the SDU to 8KB will likely produce good results. If sufficient memory is available, then using the maximum value for the SDU minimizes the number of system calls and overhead for Oracle Net Services.
Note:
Starting with Oracle Database 11 g, Oracle Net Services optimized bulk data transfer for components, such as Oracle SecureFiles LOBs and Oracle Data Guard redo transport services. The SDU size limit, as specified in the network parameter files, does not apply to these bulk data transfers.

Setting the SDU Size for the Database

To set the SDU size for the database server, configure the following files:
■ sqlnet.ora
Configure the DEFAULT_SDU_SIZE parameter in the sqlnet.ora file, as follows:
DEFAULT_SDU_SIZE=8192
■ Initialization parameter file
If using shared server processes, then set the SDU size in the DISPATCHERS parameter in the initialization parameter file, as follows:
DISPATCHERS="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp))(SDU=8192) )"
■ listener.ora
If you have configured the listener with a list of targets in the listener.ora file, then the value for SDU in the SID_LIST element overrides the current setting in the sqlnet.ora file when using dedicated server processes.
SID_LIST_listener_name=
(SID_LIST=
(SID_DESC=
(SDU=8192)
(SID_NAME=sales)))
The smaller value of the SDU size and the value configured for the client take precedence
Setting the SDU Size for the Client

To set the SDU size for the client, configure the following files:
■ sqlnet.ora
For global configuration on the client side, configure the DEFAULT_SDU_SIZE parameter in the sqlnet.ora file, as follows:
DEFAULT_SDU_SIZE=8192

■tnsnames.ora
For a particular connect descriptor, you can specify the SDU parameter in the DESCRIPTION parameter.
sales.us.example.com=
(DESCRIPTION=
(SDU=11280)
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.example.com))
)
The SDU size applies to all Oracle Net protocols for the particular connect descriptor.

时间: 2024-10-06 00:12:30

Session Data Unit的相关文章

tnsnames.ora文件说明

目录位置 unix:$ORACLE_HOME/network/admin WINDOW:%ORACLE_HOME%\network\admin 设置相应的环境变量:TNS_ADMIN tnsname.ora文件内容例子 --负载均衡,故障转移 sample2= (DESCRIPTION= (LOAD_BALANCE=on) (FAILOVER=on) (ADDRESS_LIST= (SOURCE_ROUTE=yes) (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(POR

ORACLE等待事件:SQL*Net message from client & SQL*Net message to client

在ORACLE当中有两个很常见的等待事件"SQL*Net message from client"与"SQL*Net message to client",两者有点区别,下面整理这方面的资料如下: SQL*Net message from client      表示服务端等待着Cilent发来请求让它处理,这时就会产生SQL*Net message from client等待事件. 而我们把这种Wait叫做空闲事件(ildel event),并不代表真正的Load

尖峰在线Oracle OCM实战 --开创国内Dtrace先河!

startup成功了,忙碌了很久的DBA小李合上电脑,用滚烫的开水,为自己泡一碗老坛酸菜面.中国DBA更偏爱拉上窗帘,在黑暗中享受这独特的美食.而高级DBA,则更加喜欢口感更为浓愈.甘甜的大餐:"调试"."调试",是将多种精选食材,加老火慢炖,精心烹制而成.老而津道的gdb.mdb,加上鲜脆可口DTrace,再以低层原理的温火慢顿,慢慢烹制成精致的大餐.与此同时,远在几万公里外的美国,这些食材已经非常普遍.顶级食客们Liews.tanel Poder--,都能作的一

Oracle tns 协议

下面是翻译国外的一篇博客,原文连接如下: https://thesprawl.org/research/oracle-tns-protocol/ 简介 TNS(Transparent Network Substrate) 协议用于客户端连接Oracle数据库,它可以使用其他一些协议进行通信,如:TCP/IP, IPX/SPX, IPC, Named Pipes等. 结构 TNS 包由一个header和payload 组成 HEADER 0 8 16 31 +--------------+----

oracle dataguard网络最佳实践一

oracle dataguard redo 网络最佳实践(简译) oracle dataguard好处: 1 对系统性能影响最小 这里有两个最高可用架构(MAA)场景配置,在有足够带宽的情况下,得出如下结论: 1 DG在纽约和蒙特利尔(300英里的距离,10MS的往返延迟),使用实时模式,在redo 4MB/s生成速率下,可以做到对生产系统5%的性能影响和零数据丢失: 2 在波士顿和伦敦之间(3300英里,100MS往返延迟),使用异步模式,在20MB/s的日志生成速率下,可以做到对系统5%以下

Oracle Net Listener Parameters (listener.ora)(转)

12/20 7 Oracle Net Listener Parameters (listener.ora) This chapter provides a complete listing of the listener.ora file configuration parameters. This chapter contains these topics: Overview of Oracle Net Listener Configuration File Oracle Net Listen

Spring MVC集成Spring Data Reids和Spring Session实现Session共享

说明:Spring MVC中集成Spring Data Redis和Spring Session时版本是一个坑点,比如最新版本的Spring Data Redis已经不包含Jedis了,需要自行引入.且最新版本的2.0.1会与Spring MVC 4.1.4有冲突,估计写法错了.所以要明确引入的Spring MVC版本和Spring Data Redis和Spring Session版本. 小提示:如果想要官方明确的版本可以参考Spring Boot的版本,比如我使用了1.4.7的Spring

Method of offloading iSCSI TCP/IP processing from a host processing unit, and related iSCSI TCP/IP offload engine

A method of offloading, from a host data processing unit (205), iSCSI TCP/IP processing of data streams coming through at least one TCP/IP connection (3071?,307?2?,307?3), and a related iSCSI TCP/IP Offload Engine (TOE). The method including: providi

asp.net mvc Session RedisSessionStateProvider锁的实现

最近项目用到了RedisSessionStateProvider来保存session,发现比内存session慢,后来慢慢了解,发现asp.net session是有锁的.我在文章 你的项目真的需要Session吗? redis保存session性能怎么样?也提到一些观点,本来打算在那篇文章补充一些类容,后来想了一下,还是重写一个短文吧.有关session 管道流程大家 可以参考 Asp.net Session认识加强-Session究竟是如何存储你知道吗? 我们的mvc程序都是有路由信息,那么