文档详情

Java-远程方法调用RMI参数详解.docx

发布:2018-12-28约7.05千字共5页下载文档
文本预览下载声明
Java 远程方法调用RMI参数详解 1、概述 根据RMI参数意义,可以归结为以下几点,我们可以根据这几点通过优化GC, 网络等待,流传输协议(http/rmi special socket)等方面来优化RMI。 同时,根据RMI的若干log配置,可以做到实时监控RMI网络,GC信息,针对实时监控的情况,有效地优化RMI参数设置。 2、主要参数 2.1、sun.rmi.dgc.checkInterval 查询契约间隔时间 The value of this property represents (in milliseconds) how often the Java RMI runtime checks for expired DGC leases. The default value is half the value of the java.rmi.dgc.leaseValue property. 优化:尽早的删除引用有利于管理内存,但leaseValue太短的话又会造成网络风险。这一点可根据本身的网络情况作优化。 2.2、java.rmi.dgc.leaseValue 契约时长 The value of this property represents the lease duration (in milliseconds) granted to other VMs that hold remote references to objects which have been exported by this VM. Clients usually renew a lease when it is 50% expired, so a very short value will increase network traffic and risk late renewals in exchange for reduced latency in calls to Unreferenced.unreferenced. The default value of this property is 600000 milliseconds (10 minutes). 优化:尽早的删除引用有利于管理内存,但leaseValue太短的话又会造成网络风险。这一点可根据本身的网络情况作优化。 Note that for optimal performance, the lease term should not be set toa very small value. An active RMI client automatically renews the lease when it is halfway expired, and a very small lease term would cause the client to consume precious network resources in repeatedly renewing the lease. 2.3、sun.rmi.dgc.server.gcInterval (1.2 and later) 设置服务端执行FullGC的间隔时间。 When it is necessary to ensure that unreachable remote objects are unexported and garbage collected in a timely fashion, the value of this property represents the maximum interval (in milliseconds) that the Java RMI runtime will allow between garbage collections of the local heap. The default value is 3600000 milliseconds (one hour). 优化: 尽早删除,但check 间隔同样不能太短 2.4、sun.rmi.dgc.ackTimeout 此参数意义在于,服务器端将结果返给客户端,并持续尝试设置一个引用指向返还结果。如果客户端返还失败,这个尝试过程会默认持续五分钟。 The value of this property represents the length of time (in milliseconds) that the server-side Java RMI runtime will strongly refer to a remote object (or a refe
显示全部
相似文档