Chinaunix首页 | 论坛 | 博客
  • 博客访问: 563647
  • 博文数量: 104
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1559
  • 用 户 组: 普通用户
  • 注册时间: 2014-08-21 00:58
个人简介

锻炼精神,首先要锻炼肉体

文章分类

全部博文(104)

文章存档

2018年(1)

2016年(1)

2015年(101)

2014年(1)

我的朋友

分类: Java

2015-06-19 19:10:11

With Java 7 and Sockets Direct Protocol , Java Now does RDMA ( Remote Direct Memory Access)

有了 SDP 技术支持之后的 Java 7 已经开始逐步实现 RDMA 技术 (远程内存直接访问)


RDMA is Remote Dynamic Memory Accesss -- which is a way of moving application buffers between two Java VM processes'

(executing in *nix user address space ) across a network.

RDMA 是 远程直接内存访问 --  即通过某种手段来实现通过网络传输来交换在两个虚拟机进程上运行的应用程序的缓冲空间中的数据

,其中虚拟机进程是运行在 Unix 系列操作系统的用户地址空间中的。


RDMA differs from traditional network interfaces because it bypasses the operating system .

远程内存直接访问技术区别于其他传统上的网络接口, 该种技术在网络中交换数据的全程无需操作系统做出任何控制.


This allows Java SDP over RDMA to deliver :

这使得基于 RDMA 技术之上的 Java 的 SDP技术 可以实现如下目标:


(i) The absolute lowest latency (ii) The highest throughput  (iii) Smallest CPU footprint

(i) 将绝对延迟最小化  (ii) 将吞吐量最大化 (iii) 将 CPU 的管控最小化/让其无需关心网络 IO 处理,更加集中处理计算逻辑,从而提高 CPU 的利用率


By exposing a Java join point to RDMA , SDP implicitly also enables Java to provide a very compelling "Zero-copy" capability.

通过把 Java 的连接点暴露给 RDMA ,SDP 私下里还支持 Java 实现了一个非常吸引人眼球的 "零-拷贝" 的新技术.


"Zero-copy" describes computer operations in which the CPU does not perform the task of copying data from one memory area to another .

"Zero-copy" 这一名词是用来描述计算机操作系统中的 CPU 是不会执行将数据从一个内存从拷贝到另一内存中 这样的任务.


Zero-copy versions of network protocol stacks greatly increase the performance of certain application programs and more efficiently utilize system resources.

在网络协议栈中实现的 零-拷贝 技术版本极大程度上提高了某些应用系统的性能的同时,也使它们更加充分的利用系统资源. 


Performance is enhanced by allowing the CPU to move on to other tasks while data copying procedds in parallel in another part of the machine . 

让 CPU 不参与数据拷贝工作而去处理其他的任务的同时,将数据拷贝任务在 CPU 的其他区域与 CPU 并行工作来极大地提升性能。


Also , zero-copy operations reduce the number of time-consuming mode switches between user space and kernel space.

同样,零-拷贝 操作减少了耗费时间的 用户态-系统态状态 切换的次数,从而节省了时间。


System resources are utilized more efficiently since using a sophisticated CPU to perform extensive copy operaitons,

which is a relatively simple task, is wasteful if other simpiler system components can do the copying .

系统资源其实还可以更加充分的被利用,因为如果相对简单的拷贝任务可以分配给简单的系统组件来完成,

却仍旧让一个设计精密复杂的 CPU 来执行大量的相对简单的任务操作,则实在是一种浪费。


It is important to note that the Zero-copy capability we are talking about here is not the Zero-Copy capability you can achieve by

using java.nio.channels. FileChannel's transferTo() API;.

有一点需谨记的就是,我们现在正在谈论的 "零-拷贝" 技术并非你在使用 java 编程中所使用的  java.nio.channels.FileChannel 中的 transferTo()

函数所提供的 "零-拷贝" 功能。


It is much , much more performant. 

我们谈论的"零-拷贝" 技术所提升的性能要远远高出这个 API 接口函数.


With Java 7 SDP , you directly use the native InfiniBand Zero-copy protocol implementation .

有了 Java 7 的 SDP 技术,本地 InfiniBand 零拷贝协议便可立即为你所用.


Let's start to visually depict exactly what Sockets Direct Protocol capability

looks like within the context of some typical Java deployment views.

现在让我们开始直观地描述一下,Sockets Direct Protocol 这种技术究竟在典型的 Java 部署架构图中是如何被描述的.


The following diagram illustrates how Node1 ( a java.net.Socket writer ) and Node 2 (a java.net.ServerSocket listener ) can be deployed onto a Java 7 VM configured and booted to support SDP in such a way that the JVMs can exchange application data buffers from one VM to the other , across an InfiniBand network , without any OS system-calls or services being invoked. Incredibly, the Java data transfer completely bypasses both operating systems.

下面的这幅图像我们阐述的是 Node1 (一个 java.net.Socket writer 的对象实例) 和 Node 2( 这个 Node 2 是 java.net.ServerSocket 包中 listener 的类实例对象)

 是如何被配置、部署在 Java 7 的虚拟机上的;这幅图同样描述了这两个节点(Node1,Node2) 是以何种方式来应用 SDP 技术

 -- SDP 技术实现了 JVM 可在无需 动用 任何系统调用方法或是触发任何操作系统中的服务的前提下, 经由 InfiniBand 网络传输,

 来和另一台主机上的 JVM 互换应用程序数据缓冲区中数据信息.


Incredibly , the Java data transfer completely bypasses both operating systems.

令人难以置信的是,在整个数据传输过程中都完全绕开通信双方的操作系统

/在整个数据传输过程中,通信双方的操作系统从头到尾没有参与其中

1. Java 7 application=Node 1 (JVM booted to use SDP) uses the java.net.Socket API to write a block of application data across the network to a   

   java.net.ServerSocket listener

1. 使用 Java 7 版本实现的应用程序 Node 1 (JVM 再启动的时候,就开启了 SDP 应用 ) 通过调用 java.net.Socket 包中的应用程序接口函数,

    借助于网络传输(InfiniBand ) 来将应用程序数据通过网络传输的

2. Because the JVM was booted to use SDP the Operating System TCP/IP stack is completely bypassed - the application data is  written directly to InfiniBand's  

  RDMA capability   ( requires InfiniBand to be the physical provider of Network Interface Card ) .

    由于 JVM 是以 SDP 应用开启的方式启动的, 所以 Java 的应用程序在执行写入操作的时候是直接把数据直接通过 InfiniBand 的远程内存直接访问技术

   写入到了通信端程序的内存空间中,而这一过程彻彻底底地绕过了操作系统中的 TCP/IP 协议栈。( 其中, RDMA 技术的物理设备支撑是要使用 InfiniBand 这种型号的网络接口卡的) 

 3. Java 7 application= Node2 ( JVM also booted to use SDP) uses the java.net.ServerSocket API to listen for a block of application data to arrive via RDMA across the network from

     a java.net.Socket writer . (Requires InfiniBand to be the physical provider of Network Interface Card ).

3. 基于 Java 7 版本编写的应用程序 Node 2 (同样 JMV 以开启 SDP 服务的方式启动的) 使用 java.net.ServerSocket 软件包中的函数

   来创建用于监听的类实例,该应用实例用于监听是否有属于 java.net.Socket writer 的应用程序发送的数据块,经由网络以 RDMA 的传输方式发送过来.

   (同样,这种通信方式也需要有 InfiniBand作为网络接口卡这一物理设备作为支撑的 )

4. Data delivered *directly* to de Java VM application buffer!  No OS system or service calls involved - neither from Node 1's OS nor 2's OS.

    That is the power of Java 7 Sockets Direct Protocol .

4. 传输的数据直接就被发送到了 Java 虚拟机 应用程序缓冲区中(啊)!在此过程中 Node1 和 Node 2 无任何一方的操作系统以系统调用或是提供特定服务的方式参与到其中。

   这就是 Java 7 中 SDP 技术的强大之处.    (只要998 ,**** 捧回家 的推销即视感)


What is the logical performance difference between the same application running on

 Java 7 with SDP vs. Java 6 ?

  从逻辑上分析,运行在支持 SDP 技术 的Java 7 (虚拟机) 和 Java 6 (虚拟机) 上的同一段应用程序性能上的差异(是什么--强行问号结尾?)

1. Using Java 7 with SDP configured (shown below left) How does Node 2's reception of Node 1's transmitted data travel up

      the OSI Network layer protocol stack and into the Java application ? How many steps does it take ?

1. 使用支持 SDP 技术的 Java 7 的原理图 (左下所示) 运行上一图中描述的应用程序的时候, Node2 是如何接收经由 OSI 网络协议层发送过来的

      Node1 上的数据并将其收入到自己的应用程序内存中的?  该过程共分成多少步 ?

    

       It takes only one step ! (Take a look below -- this is the great news for UHPC Java apps; now UHPC community can use Java 7 to do what needs to be done) .

      答案是一步 !(完成上述所有的操作) (看一下下面的图示你就会明白 -- 这对编写和使用 Java 应用程序的 超高性能计算组是一个天大的好消息; 现在 超高性能计算组 已经

     可以借助于 Java 7 来将这套理论用在实际的工作中了)

 2. Using Java 6 ( no SDP - shown below right ) How does Node 2's reception of Node 1's transmitted data travel up the OSI Network layer protocol stack and into the Java

     application ?      How many steps does it take ? It takes five stepts( Take a look below -- this is the familiar TCP/IP protocol stack -- not SDP. It works for most ,

    but does not work for the UHPC community . UHPC community just can't use Java 6 to do what needs to be done ).

 2. 运行于 Java 6 虚拟机上的相同程序 (版本 6 不支持 SDP 技术,其原理图如下图右半部分所示)  如何实现 在 Node 2 上接收来自 Node 1 发送的经由 OSI 网络层的协议栈

   的数据信息,并将其存放到自身应用程序内存空间中 这一系列的操作 ? 这一过程共分为几个步骤?  答案是需要 5 步 (简单的来看一下下面的图示 -- 整个的传输过程和 TCP/IP 协议栈很相似 --

   却和 SDP 完全不同。 TCP/IP 协议栈的流程为大多数的服务所用,但是却并不是 高性能计算组的选择。高性能计算组使用 6 代 Java 虚拟机的话是无法正常处理日常事务的.

  

阅读(2339) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~